From f45698885d0d396c2ac8174a8f33183eb996a4e2 Mon Sep 17 00:00:00 2001 From: joeycli Date: Mon, 16 Oct 2023 09:24:42 +0800 Subject: [PATCH] fix: lint error --- core/blockchain.go | 7 +++---- core/state/statedb.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) 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 {