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

sync: log a message when there aren't enough peers #5105

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)

const PropagationDelaySecs = uint64(6)

// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
const BootstrapPeerThreshold = 4
1 change: 1 addition & 0 deletions chain/sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func (sm *syncManager) handlePeerHead(head peerHead) {

// not yet; do we have enough peers?
if len(sm.heads) < BootstrapPeerThreshold {
log.Debugw("not tracking enough peers to start sync worker", "have", len(sm.heads), "need", BootstrapPeerThreshold)
// not enough peers; track it and wait
return
}
Expand Down