mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
p2p/tracker: fix head detection in Fulfil to avoid unnecessary timer reschedules
This commit is contained in:
parent
e63e37be5e
commit
9f62d3b188
1 changed files with 2 additions and 1 deletions
|
|
@ -185,9 +185,10 @@ func (t *Tracker) Fulfil(peer string, version uint, code uint64, id uint64) {
|
|||
return
|
||||
}
|
||||
// Everything matches, mark the request serviced and meter it
|
||||
wasHead := t.expire.Front() == req.expire
|
||||
t.expire.Remove(req.expire)
|
||||
delete(t.pending, id)
|
||||
if req.expire.Prev() == nil {
|
||||
if wasHead {
|
||||
if t.wake.Stop() {
|
||||
t.schedule()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue