diff --git a/core/blockchain.go b/core/blockchain.go index 54be214e70..f35b4e4c05 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -785,15 +785,13 @@ func (bc *BlockChain) loadLastState() error { log.Info("begin rewind versa db head", "target_number", archiveVersion, "target_root", archiveRoot.String()) for { log.Info("rewinding block", "number", headBlock.NumberU64(), "hash", headBlock.Hash(), "root", headBlock.Root().String(), "target_number", archiveVersion, "target_root", archiveRoot.String()) - if archiveRoot.Cmp(headBlock.Root()) == 0 && archiveVersion == headBlock.Number().Int64() { + if archiveRoot.Cmp(headBlock.Root()) == 0 { rawdb.WriteCanonicalHash(bc.db, headBlock.Hash(), headBlock.NumberU64()) rawdb.WriteHeadHeaderHash(bc.db, headBlock.Hash()) rawdb.WriteHeadBlockHash(bc.db, headBlock.Hash()) rawdb.WriteHeadFastBlockHash(bc.db, headBlock.Hash()) log.Info("success to reset versa db head block", "number", headBlock.NumberU64(), "hash", headBlock.Hash(), "root", headBlock.Root().String()) break - } else if archiveRoot.Cmp(headBlock.Root()) == 0 { - log.Info("reset versa db meet same root", "number", headBlock.NumberU64(), "target_number", archiveVersion, "target_root", archiveRoot.String()) } else if archiveVersion == headBlock.Number().Int64() { log.Crit("failed to reset versa db meet same version", "number", headBlock.NumberU64(), "target_number", archiveVersion, "target_root", archiveRoot.String()) }