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

pull/84/head
Maran 11 years ago
parent a5963d1377
commit b9876df5dc
  1. 6
      ethereal/ethereum.go
  2. 6
      ethereum/ethereum.go

@ -100,9 +100,13 @@ func main() {
}
if StartRpc {
ethereum.RpcServer = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()))
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)

@ -133,9 +133,13 @@ func main() {
go console.Start()
}
if StartRpc {
ethereum.RpcServer = ethrpc.NewJsonRpcServer(ethpub.NewPEthereum(ethereum.StateManager(), ethereum.BlockChain(), ethereum.TxPool()))
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)

Loading…
Cancel
Save