Merge pull request #5105 from filecoin-project/feat/log-insufficent-peers

sync: log a message when there aren't enough peers
This commit is contained in:
Łukasz Magiera
2020-12-03 12:53:40 +01:00
committed by GitHub
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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
View File
@@ -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
}