This commit is contained in:
Calvin Kim 2025-03-10 22:47:59 +07:00 committed by GitHub
commit 73a339b2e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -309,6 +309,11 @@ func (sm *SyncManager) startSync() {
higherPeers = append(higherPeers, peer)
}
if sm.chain.IsCurrent() && len(higherPeers) == 0 {
log.Infof("Caught up to block %s(%d)", best.Hash.String(), best.Height)
return
}
// Pick randomly from the set of peers greater than our block height,
// falling back to a random peer of the same height if none are greater.
//