Skip to content

Commit 6e88a28

Browse files
committed
fix offset when stopping blockchain
1 parent 79c1b15 commit 6e88a28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/blockchain.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ func (bc *BlockChain) Stop() {
883883
if !bc.cacheConfig.TrieDirtyDisabled {
884884
triedb := bc.stateCache.TrieDB()
885885

886-
for _, offset := range []uint64{0, 1, bc.cacheConfig.TriesInMemory} {
886+
for _, offset := range []uint64{0, 1, bc.cacheConfig.TriesInMemory - 1} {
887887
if number := bc.CurrentBlock().NumberU64(); number > offset {
888888
recent := bc.GetBlockByNumber(number - offset)
889889
if recent.Root() == (common.Hash{}) {

0 commit comments

Comments
 (0)