diff --git a/core/blockchain.go b/core/blockchain.go index d173b2de294dd1df1cc7a652b80bc8fae4e6a4ad..ee1c0702b5f439048e10d0d90e0654ae92490762 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -445,7 +445,11 @@ func (bc *BlockChain) repair(head **types.Block) error { return nil } // Otherwise rewind one block and recheck state availability there - (*head) = bc.GetBlock((*head).ParentHash(), (*head).NumberU64()-1) + block := bc.GetBlock((*head).ParentHash(), (*head).NumberU64()-1) + if block == nil { + return fmt.Errorf("failed to repair block, can not get block at height %d", (*head).NumberU64()) + } + (*head) = block } } diff --git a/node/node.go b/node/node.go index 85299dba7462d4e11deb7a178740423c6227689d..0a931a9dd54856a4e053c8e8bf555cdc48beb8a2 100644 --- a/node/node.go +++ b/node/node.go @@ -322,7 +322,7 @@ func (n *Node) stopIPC() { n.ipcListener.Close() n.ipcListener = nil - n.log.Info("IPC endpoint closed", "endpoint", n.ipcEndpoint) + n.log.Info("IPC endpoint closed", "url", n.ipcEndpoint) } if n.ipcHandler != nil { n.ipcHandler.Stop() diff --git a/rpc/ipc.go b/rpc/ipc.go index b05e503d7427859a687c09a37d22c90a9694c6eb..1467f7a0c996145c665dde7485dfd0d37fe20ebc 100644 --- a/rpc/ipc.go +++ b/rpc/ipc.go @@ -24,17 +24,17 @@ import ( "github.com/ethereum/go-ethereum/p2p/netutil" ) -// ServeListener accepts connections on l, serving JSON-RPC on them. +// ServeListener accepts connections on l, serving IPC-RPC on them. func (srv *Server) ServeListener(l net.Listener) error { for { conn, err := l.Accept() if netutil.IsTemporaryError(err) { - log.Warn("RPC accept error", "err", err) + log.Warn("IPC accept error", "err", err) continue } else if err != nil { return err } - log.Trace("Accepted connection", "addr", conn.RemoteAddr()) + log.Trace("IPC accepted connection") go srv.ServeCodec(NewJSONCodec(conn), OptionMethodInvocation|OptionSubscriptions) } }