Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netsync: don't ask for blocks from peers on the same block height #213

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions netsync/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,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.
//
Expand Down
Loading