From b0f358e54b65863be86e4a4ee03cc900a54299ad Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Mon, 27 May 2024 19:13:49 +0700 Subject: [PATCH] save --- turbo/stages/stageloop.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/turbo/stages/stageloop.go b/turbo/stages/stageloop.go index 0cee31fa297..11267f41f97 100644 --- a/turbo/stages/stageloop.go +++ b/turbo/stages/stageloop.go @@ -104,6 +104,7 @@ func StageLoop( // ProcessFrozenBlocks - withuot global rwtx func ProcessFrozenBlocks(ctx context.Context, db kv.RwDB, blockReader services.FullBlockReader, sync *stagedsync.Sync) error { sawZeroBlocksTimes := 0 + firstCycle := true for { var finStageProgress uint64 if blockReader.FrozenBlocks() > 0 { @@ -127,15 +128,16 @@ func ProcessFrozenBlocks(ctx context.Context, db kv.RwDB, blockReader services.F log.Debug("[sync] processFrozenBlocks", "finStageProgress", finStageProgress, "frozenBlocks", blockReader.FrozenBlocks()) - more, err := sync.Run(db, wrap.TxContainer{}, true, false) + more, err := sync.Run(db, wrap.TxContainer{}, firstCycle, false) if err != nil { return err } - if err := sync.RunPrune(db, nil, true, false); err != nil { + if err := sync.RunPrune(db, nil, firstCycle, false); err != nil { return err } + firstCycle = false if !more { break }