Waiting condition check prior to waiting log entry (#3802)

This commit is contained in:
Jim McDonald 2019-10-19 21:35:45 +01:00 committed by Preston Van Loon
parent 04113baf9d
commit 5000535907

View File

@ -92,14 +92,13 @@ func (s *InitialSync) Start() {
// Every 5 sec, report handshake count.
for {
count := peerstatus.Count()
if count >= minStatusCount {
break
}
log.WithField(
"handshakes",
fmt.Sprintf("%d/%d", count, minStatusCount),
).Info("Waiting for enough peer handshakes before syncing")
if count >= minStatusCount {
break
}
time.Sleep(handshakePollingInterval)
}