check recent syncs in selectSyncTarget/selectDeferredSyncTarget
This commit is contained in:
parent
8d25fd39cf
commit
f6ecff0e26
@ -440,6 +440,10 @@ func (sm *syncManager) selectSyncTarget(done *types.TipSet) (*types.TipSet, bool
|
||||
}
|
||||
}
|
||||
|
||||
if sm.recent.Synced(heaviest) {
|
||||
return sm.selectDeferredSyncTarget()
|
||||
}
|
||||
|
||||
return heaviest, true, nil
|
||||
}
|
||||
|
||||
@ -451,6 +455,11 @@ deferredLoop:
|
||||
bucket := sm.deferred.Pop()
|
||||
heaviest := bucket.heaviestTipSet()
|
||||
|
||||
if sm.recent.Synced(heaviest) {
|
||||
// we have synced it or something heavier recently, skip it
|
||||
continue deferredLoop
|
||||
}
|
||||
|
||||
if sm.pend.RelatedToAny(heaviest) {
|
||||
// this has converged to a pending sync, insert it to the pending queue
|
||||
sm.pend.Insert(heaviest)
|
||||
|
Loading…
Reference in New Issue
Block a user