Added support to NewJsonRpc to return an error as well as an interface

This commit is contained in:
Maran 2014-05-13 11:48:52 +02:00
parent a5963d1377
commit b9876df5dc
2 changed files with 12 additions and 4 deletions

View File

@ -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)

View File

@ -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)