diff --git a/core/blockchain.go b/core/blockchain.go index 94c54fc996..a9de1aabd3 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1180,8 +1180,7 @@ func (bc *BlockChain) Stop() { // - HEAD-127: So we have a hard limit on the number of blocks reexecuted if !bc.cacheConfig.TrieDirtyDisabled { triedb := bc.triedb - var once sync.Once - + var once sync.Once for _, offset := range []uint64{0, 1, TriesInMemory - 1} { if number := bc.CurrentBlock().Number.Uint64(); number > offset { recent := bc.GetBlockByNumber(number - offset) @@ -1191,9 +1190,9 @@ func (bc *BlockChain) Stop() { } else { rawdb.WriteSafePointBlockNumber(bc.db, recent.NumberU64()) once.Do(func() { - rawdb.WriteHeadBlockHash(bc.db, recent.Hash()) + rawdb.WriteHeadBlockHash(bc.db, recent.Hash()) }) - } + } } } if snapBase != (common.Hash{}) { diff --git a/core/state/statedb.go b/core/state/statedb.go index 24ff0f3497..8c1b7eaea0 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1401,7 +1401,7 @@ func (s *StateDB) slowDeleteStorage(addr common.Address, addrHash common.Hash, r } // skip deleting storages for EmptyTrie if _, ok := tr.(*trie.EmptyTrie); ok { - return false, nil, nil, nil + return false, 0, nil, nil, nil } it, err := tr.NodeIterator(nil) if err != nil {