Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,20 @@ func (pool *LegacyPool) Filter(tx *types.Transaction) bool {
func (pool *LegacyPool) Init(gasTip *big.Int, head *types.Header) error {
// Set the basic pool parameters
pool.gasTip.Store(gasTip)
pool.reset(nil, head)

// Initialize the state with head block, or fallback to empty one in
// case the head state is not available(might occur when node is not
// fully synced).
statedb, err := pool.chain.StateAt(head.Root)
if err != nil {
statedb, err = pool.chain.StateAt(types.EmptyRootHash)
}
if err != nil {
return err
}
pool.currentHead.Store(head)
pool.currentState = statedb
pool.pendingNonces = newNoncer(statedb)

// Start the reorg loop early, so it can handle requests generated during
// journal loading.
Expand Down