[#1181] Correct computation of progress for Spend before Sync

- the computation of progress changed, the total range is computed, that way it works for any kind of sync algorithm
- the progress depends on finished scan action, whenever it processes some blocks, it's counted up
- the final progress is a ratio between these new values
This commit is contained in:
Lukas Korba 2023-08-10 16:08:01 +02:00
parent cbcbf61d9a
commit 80eb3b1c8d
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ enum DemoAppConfig {
static let defaultSeed = try! Mnemonic.deterministicSeedBytes(from: """
kitchen renew wide common vague fold vacuum tilt amazing pear square gossip jewel month tree shock scan alpha just spot fluid toilet view dinner
""")
static let otherSynchronizers: [SynchronizerInitData] = [
SynchronizerInitData(
alias: .custom("alt-sync-1"),

View File

@ -46,7 +46,7 @@ extension ProcessSuggestedScanRangesAction: Action {
await context.update(lastScannedHeight: lowerBound)
await context.update(lastDownloadedHeight: lowerBound)
await context.update(syncControlData: syncControlData)
// the total progress range is computed only for the first time
// as a sum of all ranges
let totalProgressRange = await context.totalProgressRange