Skip to content

Commit 5675916

Browse files
committed
fixup! put difflayer into verifyManage cache when node restart
1 parent 34e8ce0 commit 5675916

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/remote_state_verifier.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ func NewVerifyManager(blockchain *BlockChain, peers verifyPeers, allowInsecure b
6969
if oldBlock == nil {
7070
return nil, fmt.Errorf("block is nil, number: %d", number)
7171
}
72-
_, err := blockchain.GenerateDiffLayer(oldBlock.Hash())
72+
blockHash := oldBlock.Hash()
73+
_, err := blockchain.GenerateDiffLayer(blockHash)
7374
if err != nil {
7475
return nil, err
7576
}
77+
diffLayerCh := make(chan struct{})
78+
close(diffLayerCh)
79+
blockchain.diffLayerChanCache.Add(blockHash, diffLayerCh)
7680
}
7781

7882
vm := &remoteVerifyManager{

0 commit comments

Comments
 (0)