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

catchup: Catchup variable reuse #5551

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions catchup/catchpointService.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
// noPeersAvailableSleepInterval is the sleep interval that the node would wait if no peers are available to download the next block from.
// this delay is intended to ensure to give the network package some time to download the list of relays.
noPeersAvailableSleepInterval = 50 * time.Millisecond

// checkLedgerDownloadRetries is the number of times the catchpoint service will attempt to HEAD request the
// ledger from peers when `Start`ing catchpoint catchup
checkLedgerDownloadRetries = 10
)

// CatchpointCatchupNodeServices defines the external node support needed
Expand Down Expand Up @@ -826,7 +822,7 @@
}
peerSelector := makePeerSelector(cs.net, []peerClass{{initialRank: peerRankInitialFirstPriority, peerClass: network.PeersPhonebookRelays}})
ledgerFetcher := makeLedgerFetcher(cs.net, cs.ledgerAccessor, cs.log, cs, cs.config)
for i := 0; i < checkLedgerDownloadRetries; i++ {
for i := 0; i < cs.config.CatchupLedgerDownloadRetryAttempts; i++ {

Check warning on line 825 in catchup/catchpointService.go

View check run for this annotation

Codecov / codecov/patch

catchup/catchpointService.go#L825

Added line #L825 was not covered by tests
psp, peerError := peerSelector.getNextPeer()
if peerError != nil {
return err
Expand Down