aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-13 20:43:08 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-13 20:43:08 +0800
commit20ea78945e751a1ad11e2b2fc7c4224f4c46e108 (patch)
tree744dd114c51e056d8e4db2f1216c99e901f9586c /ethereum
parentdd60382fc3724ee9c9507cba8df9e6d6db1d5d51 (diff)
downloadgo-tangerine-20ea78945e751a1ad11e2b2fc7c4224f4c46e108.tar.gz
go-tangerine-20ea78945e751a1ad11e2b2fc7c4224f4c46e108.tar.zst
go-tangerine-20ea78945e751a1ad11e2b2fc7c4224f4c46e108.zip
Implemented new JS/EthPub methods
- getTxCountAt - getPeerCount - getIsMining - getIsListening - getCoinbase
Diffstat (limited to 'ethereum')
-rw-r--r--ethereum/ethereum.go47
1 files changed, 25 insertions, 22 deletions
diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go
index 5b578deba..8b22533d9 100644
--- a/ethereum/ethereum.go
+++ b/ethereum/ethereum.go
@@ -122,28 +122,8 @@ func main() {
// Set the max peers
ethereum.MaxPeers = MaxPeer
- if StartConsole {
- err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm)
- // Error is OK if the error is ErrExist
- if err != nil && !os.IsExist(err) {
- log.Panic("Unable to create EXECPATH:", err)
- }
-
- console := NewConsole(ethereum)
- go console.Start()
- }
- if StartRpc {
- ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum), RpcPort)
- if err != nil {
- logger.Infoln("Could not start RPC interface:", err)
- } else {
- go ethereum.RpcServer.Start()
- }
- }
-
- RegisterInterrupts(ethereum)
-
- ethereum.Start(UseSeed)
+ // Set Mining status
+ ethereum.Mining = StartMining
if StartMining {
logger.Infoln("Miner started")
@@ -168,6 +148,29 @@ func main() {
}
+ if StartConsole {
+ err := os.Mkdir(ethutil.Config.ExecPath, os.ModePerm)
+ // Error is OK if the error is ErrExist
+ if err != nil && !os.IsExist(err) {
+ log.Panic("Unable to create EXECPATH:", err)
+ }
+
+ console := NewConsole(ethereum)
+ go console.Start()
+ }
+ if StartRpc {
+ ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum), RpcPort)
+ if err != nil {
+ logger.Infoln("Could not start RPC interface:", err)
+ } else {
+ go ethereum.RpcServer.Start()
+ }
+ }
+
+ RegisterInterrupts(ethereum)
+
+ ethereum.Start(UseSeed)
+
// Wait for shutdown
ethereum.WaitForShutdown()
}