Skip to content

Commit

Permalink
Merge branch 'master' into multipleBranchProcessing
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas committed Aug 17, 2020
2 parents 5f0565f + bde3073 commit 8ea515b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions beacon-chain/sync/initial-sync/blocks_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const (
// Each step is managed by assigned finite state machine.
lookaheadSteps = 8
// noFinalizedPeersErrMaxRetries defines number of retries when no finalized peers are found.
noFinalizedPeersErrMaxRetries = 100
noFinalizedPeersErrMaxRetries = 1000
// noFinalizedPeersErrRefreshInterval defines interval for which queue will be paused before
// making the next attempt to obtain data.
noFinalizedPeersErrRefreshInterval = 15 * time.Second
)

var (
Expand Down Expand Up @@ -191,8 +194,11 @@ func (q *blocksQueue) loop() {
forceExit := q.exitConditions.noFinalizedPeersErrRetries > noFinalizedPeersErrMaxRetries
if q.mode == modeStopOnFinalizedEpoch || forceExit {
q.cancel()
} else {
q.exitConditions.noFinalizedPeersErrRetries++
log.Debug("Waiting for finalized peers")
time.Sleep(noFinalizedPeersErrRefreshInterval)
}
q.exitConditions.noFinalizedPeersErrRetries++
continue
}
}
Expand Down

0 comments on commit 8ea515b

Please sign in to comment.