core, eth: abort snapshot generation on snap sync and resume later

This commit is contained in:
Péter Szilágyi
2021-04-29 17:33:45 +03:00
parent 871f50b911
commit 745757ac6b
10 changed files with 115 additions and 31 deletions

View File

@ -640,7 +640,8 @@ func (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error {
headBlockGauge.Update(int64(block.NumberU64()))
bc.chainmu.Unlock()
// Destroy any existing state snapshot and regenerate it in the background
// Destroy any existing state snapshot and regenerate it in the background,
// also resuming the normal maintenance of any previously paused snapshot.
if bc.snaps != nil {
bc.snaps.Rebuild(block.Root())
}