From b9876df5dc719f583172017cc71af146c6f732a9 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 13 May 2014 11:48:52 +0200 Subject: Added support to NewJsonRpc to return an error as well as an interface --- ethereum/ethereum.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ethereum') 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) -- cgit v1.2.3