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 c7add2e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions core/blockchain.go
Expand Up @@ -800,12 +800,8 @@ 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 c7add2e

Please sign in to comment.