Forward sync should always start from finalized epoch's first slot.

This commit is contained in:
cheatfate 2020-07-04 09:55:45 +03:00 committed by zah
parent 293d990d43
commit 322ec3d2f9
1 changed files with 2 additions and 2 deletions

View File

@ -586,7 +586,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
peer.updateScore(PeerScoreGoodBlocks)
return res
let queue = SyncQueue.init(A, getLocalHeadSlotCb(), getLocalWallSlotCb(),
let queue = SyncQueue.init(A, getFSAFECb(), getLocalWallSlotCb(),
chunkSize, syncUpdate, getFSAFECb, 2)
result = SyncManager[A, B](
@ -875,7 +875,7 @@ proc sync*[A, B](man: SyncManager[A, B]) {.async.} =
debug "Synchronization lost, restoring",
wall_head_slot = wallSlot, local_head_slot = headSlot,
queue_last_slot = man.queue.lastSlot, topics = "syncman"
man.queue = SyncQueue.init(A, headSlot, wallSlot,
man.queue = SyncQueue.init(A, man.getFirstSlotAFE(), wallSlot,
man.chunkSize, man.syncUpdate,
man.getFirstSlotAFE, 2)