[NOD-726] Only print "no sync peer" message when not current (#646)

* [NOD-726] Only print "no sync peer" message when not current.

* [NOD-726] Shorten duration in which "no sync peer" messages would not print.
This commit is contained in:
stasatdaglabs 2020-02-27 17:38:40 +02:00 committed by GitHub
parent 2373965551
commit 80b5631a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,12 +207,13 @@ func (sm *SyncManager) startSync() {
return
}
log.Warnf("No sync peer candidates available")
if sm.shouldQueryPeerSelectedTips() {
hasSyncCandidates := false
for peer, state := range sm.peerStates {
if !state.syncCandidate {
continue
}
hasSyncCandidates = true
if time.Since(state.lastSelectedTipRequest) < minGetSelectedTipInterval {
continue
@ -220,6 +221,9 @@ func (sm *SyncManager) startSync() {
queueMsgGetSelectedTip(peer, state)
}
if !hasSyncCandidates {
log.Warnf("No sync peer candidates available")
}
}
}