Statediffing #5

Closed
elizabethengelman wants to merge 122 commits from statediff-for-archive-node into master
3 changed files with 9 additions and 5 deletions
Showing only changes of commit 21dd59bd04 - Show all commits

View File

@ -445,7 +445,11 @@ func (bc *BlockChain) repair(head **types.Block) error {
return nil return nil
} }
// Otherwise rewind one block and recheck state availability there // 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
} }
} }

View File

@ -322,7 +322,7 @@ func (n *Node) stopIPC() {
n.ipcListener.Close() n.ipcListener.Close()
n.ipcListener = nil 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 { if n.ipcHandler != nil {
n.ipcHandler.Stop() n.ipcHandler.Stop()

View File

@ -24,17 +24,17 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil" "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 { func (srv *Server) ServeListener(l net.Listener) error {
for { for {
conn, err := l.Accept() conn, err := l.Accept()
if netutil.IsTemporaryError(err) { if netutil.IsTemporaryError(err) {
log.Warn("RPC accept error", "err", err) log.Warn("IPC accept error", "err", err)
continue continue
} else if err != nil { } else if err != nil {
return err return err
} }
log.Trace("Accepted connection", "addr", conn.RemoteAddr()) log.Trace("IPC accepted connection")
go srv.ServeCodec(NewJSONCodec(conn), OptionMethodInvocation|OptionSubscriptions) go srv.ServeCodec(NewJSONCodec(conn), OptionMethodInvocation|OptionSubscriptions)
} }
} }