From 56759163491262a7db5d49e1cc3c88a8e28a4507 Mon Sep 17 00:00:00 2001 From: j75689 Date: Thu, 14 Apr 2022 01:16:00 +0800 Subject: [PATCH] fixup! put difflayer into verifyManage cache when node restart --- core/remote_state_verifier.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/remote_state_verifier.go b/core/remote_state_verifier.go index bd85b46eff..c190671850 100644 --- a/core/remote_state_verifier.go +++ b/core/remote_state_verifier.go @@ -69,10 +69,14 @@ func NewVerifyManager(blockchain *BlockChain, peers verifyPeers, allowInsecure b if oldBlock == nil { return nil, fmt.Errorf("block is nil, number: %d", number) } - _, err := blockchain.GenerateDiffLayer(oldBlock.Hash()) + blockHash := oldBlock.Hash() + _, err := blockchain.GenerateDiffLayer(blockHash) if err != nil { return nil, err } + diffLayerCh := make(chan struct{}) + close(diffLayerCh) + blockchain.diffLayerChanCache.Add(blockHash, diffLayerCh) } vm := &remoteVerifyManager{