mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
parent
dee0e37564
commit
86cbf4a897
1 changed files with 14 additions and 1 deletions
|
|
@ -310,7 +310,20 @@ func (pool *LegacyPool) Filter(tx *types.Transaction) bool {
|
||||||
func (pool *LegacyPool) Init(gasTip *big.Int, head *types.Header) error {
|
func (pool *LegacyPool) Init(gasTip *big.Int, head *types.Header) error {
|
||||||
// Set the basic pool parameters
|
// Set the basic pool parameters
|
||||||
pool.gasTip.Store(gasTip)
|
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
|
// Start the reorg loop early, so it can handle requests generated during
|
||||||
// journal loading.
|
// journal loading.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue