From 1e44aa6859e37817f6d25fb70ab507e4423b284e Mon Sep 17 00:00:00 2001 From: j75689 Date: Tue, 19 Apr 2022 17:54:37 +0800 Subject: [PATCH] fixup! rewind to last non verified block when restart fast node --- core/remote_state_verifier.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/remote_state_verifier.go b/core/remote_state_verifier.go index a8e99e4c09..7c1687fd83 100644 --- a/core/remote_state_verifier.go +++ b/core/remote_state_verifier.go @@ -71,7 +71,7 @@ func NewVerifyManager(blockchain *BlockChain, peers verifyPeers, allowInsecure b numberU64 := number.Uint64() blockchain.SetHead(numberU64) block := blockchain.GetBlockByNumber(numberU64) - for i := 0; i < maxForkHeight; i++ { + for i := 0; i < maxForkHeight && block.NumberU64() > 0; i++ { // When inserting a block, // the block before 11 blocks will be verified, // so the parent block of 11-22 will directly write the verification information.