Ensure to return err for nil RPCCLient

This commit is contained in:
Alexander Ewetumo 2017-10-26 14:25:38 +01:00
parent efa10134e8
commit 8145412d1c
1 changed files with 4 additions and 0 deletions

View File

@ -231,6 +231,10 @@ func (m *StatusBackend) DiscardTransactions(ids []common.QueuedTxID) map[common.
// registerHandlers attaches Status callback handlers to running node
func (m *StatusBackend) registerHandlers() error {
rpcClient := m.NodeManager().RPCClient()
if rpcClient == nil {
return node.ErrRPCClient
}
rpcClient.RegisterHandler("eth_accounts", m.accountManager.AccountsRPCHandler())
rpcClient.RegisterHandler("eth_sendTransaction", m.txQueueManager.SendTransactionRPCHandler)