Merge pull request #22777 from karalabe/snapshots-abort-resume-on-sync

core, eth: abort snapshot generation on snap sync and resume later
This commit is contained in:
Péter Szilágyi
2021-04-30 17:04:05 +03:00
committed by GitHub
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())
}