diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-13 17:48:52 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-13 17:50:39 +0800 |
commit | b9876df5dc719f583172017cc71af146c6f732a9 (patch) | |
tree | aed57e24d6cca0ad1f4310fbd5b362849777582c | |
parent | a5963d1377ab1a4a82d5b2881e820121ac3da564 (diff) | |
download | dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar.gz dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar.bz2 dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar.lz dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar.xz dexon-b9876df5dc719f583172017cc71af146c6f732a9.tar.zst dexon-b9876df5dc719f583172017cc71af146c6f732a9.zip |
Added support to NewJsonRpc to return an error as well as an interface
-rw-r--r-- | ethereal/ethereum.go | 8 | ||||
-rw-r--r-- | ethereum/ethereum.go | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/ethereal/ethereum.go b/ethereal/ethereum.go index 1a6ab0044..bacf6d446 100644 --- a/ethereal/ethereum.go +++ b/ethereal/ethereum.go @@ -100,8 +100,12 @@ func main() { } if StartRpc { - ethereum.RpcServer = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) - go ethereum.RpcServer.Start() + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) + if err != nil { + log.Println("Could not start RPC interface:", err) + } else { + go ethereum.RpcServer.Start() + } } log.Printf("Starting Ethereum GUI v%s\n", ethutil.Config.Ver) diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go index 2f05bf2a1..8ef061be0 100644 --- a/ethereum/ethereum.go +++ b/ethereum/ethereum.go @@ -133,8 +133,12 @@ func main() { go console.Start() } if StartRpc { - ethereum.RpcServer = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) - go ethereum.RpcServer.Start() + ethereum.RpcServer, err = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool())) + if err != nil { + logger.Infoln("Could not start RPC interface:", err) + } else { + go ethereum.RpcServer.Start() + } } RegisterInterrupts(ethereum) |