mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 20:41:20 +00:00
eth/downloader: fix a potential issue against future refactors
This commit is contained in:
parent
5884606ec3
commit
96c2ab22e0
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user