mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
Relinquish peerLock when blockFetcher context is done (#10932)
* Relinquish peerLock when blockFetcher context is done * Unlock before sending range requests Co-authored-by: Radosław Kapka <rkapka@wp.pl> Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
parent
3a841a8467
commit
dfe8e54a42
@ -318,6 +318,7 @@ func (f *blocksFetcher) requestBlocks(
|
|||||||
}).Debug("Requesting blocks")
|
}).Debug("Requesting blocks")
|
||||||
if f.rateLimiter.Remaining(pid.String()) < int64(req.Count) {
|
if f.rateLimiter.Remaining(pid.String()) < int64(req.Count) {
|
||||||
if err := f.waitForBandwidth(pid); err != nil {
|
if err := f.waitForBandwidth(pid); err != nil {
|
||||||
|
l.Unlock()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,6 +346,7 @@ func (f *blocksFetcher) requestBlocksByRoot(
|
|||||||
}).Debug("Requesting blocks (by roots)")
|
}).Debug("Requesting blocks (by roots)")
|
||||||
if f.rateLimiter.Remaining(pid.String()) < int64(len(*req)) {
|
if f.rateLimiter.Remaining(pid.String()) < int64(len(*req)) {
|
||||||
if err := f.waitForBandwidth(pid); err != nil {
|
if err := f.waitForBandwidth(pid); err != nil {
|
||||||
|
l.Unlock()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user