good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 96c2ab22 authored by Péter Szilágyi's avatar Péter Szilágyi
Browse files

eth/downloader: fix a potential issue against future refactors

parent 5884606e
No related branches found
No related tags found
No related merge requests found
...@@ -1491,6 +1491,10 @@ func (d *Downloader) qosTuner() { ...@@ -1491,6 +1491,10 @@ func (d *Downloader) qosTuner() {
func (d *Downloader) qosReduceConfidence() { func (d *Downloader) qosReduceConfidence() {
// If we have a single peer, confidence is always 1 // If we have a single peer, confidence is always 1
peers := uint64(d.peers.Len()) peers := uint64(d.peers.Len())
if peers == 0 {
// Ensure peer connectivity races don't catch us off guard
return
}
if peers == 1 { if peers == 1 {
atomic.StoreUint64(&d.rttConfidence, 1000000) atomic.StoreUint64(&d.rttConfidence, 1000000)
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment