mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 14:21:14 +00:00
evidence: manage and initialize state objects more clearly in the pool (#8080)
This commit is contained in:
12
node/node.go
12
node/node.go
@@ -62,7 +62,8 @@ type nodeImpl struct {
|
||||
// services
|
||||
eventSinks []indexer.EventSink
|
||||
stateStore sm.Store
|
||||
blockStore *store.BlockStore // store the blockchain to disk
|
||||
blockStore *store.BlockStore // store the blockchain to disk
|
||||
evPool *evidence.Pool
|
||||
stateSync bool // whether the node should state sync on startup
|
||||
stateSyncReactor *statesync.Reactor // for hosting and restoring state sync snapshots
|
||||
|
||||
@@ -388,6 +389,7 @@ func makeNode(
|
||||
blockStore: blockStore,
|
||||
stateSyncReactor: stateSyncReactor,
|
||||
stateSync: stateSync,
|
||||
evPool: evPool,
|
||||
|
||||
shutdownOps: makeCloser(closers),
|
||||
|
||||
@@ -462,6 +464,14 @@ func (n *nodeImpl) OnStart(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
state, err := n.stateStore.Load()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := n.evPool.Start(state); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
n.rpcEnv.NodeInfo = n.nodeInfo
|
||||
// Start the RPC server before the P2P server
|
||||
// so we can eg. receive txs for the first block
|
||||
|
||||
Reference in New Issue
Block a user