Skip to content

Commit

Permalink
core: revert change in blockchain.go
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Jan 18, 2022
1 parent 7855d61 commit 5c2047c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions core/blockchain.go
Expand Up @@ -800,12 +800,7 @@ func (bc *BlockChain) Stop() {

for _, offset := range []uint64{0, 1, TriesInMemory - 1} {
if number := bc.CurrentBlock().NumberU64(); number > offset {
num := number - offset
recent := bc.GetBlockByNumber(num)
if recent == nil {
log.Error("Failed to get block", num)
continue
}
recent := bc.GetBlockByNumber(number - offset)
log.Info("Writing cached state to disk", "block", recent.Number(), "hash", recent.Hash(), "root", recent.Root())
if err := triedb.Commit(recent.Root(), true, nil); err != nil {
log.Error("Failed to commit recent state trie", "err", err)
Expand Down

0 comments on commit 5c2047c

Please sign in to comment.