Skip to content

Commit

Permalink
Merge pull request ethereum#22753 from karalabe/p2p-tracker-stopfix
Browse files Browse the repository at this point in the history
p2p/tracker: only reschedule wake if previous didn't run
  • Loading branch information
karalabe authored Apr 27, 2021
2 parents 55043ee + ff3535e commit d9c9ee5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/tracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ func (t *Tracker) Fulfil(peer string, version uint, code uint64, id uint64) {
t.expire.Remove(req.expire)
delete(t.pending, id)
if req.expire.Prev() == nil {
t.wake.Stop()
t.schedule()
if t.wake.Stop() {
t.schedule()
}
}
g := fmt.Sprintf("%s/%s/%d/%#02x", trackedGaugeName, t.protocol, req.version, req.reqCode)
metrics.GetOrRegisterGauge(g, nil).Dec(1)
Expand Down

0 comments on commit d9c9ee5

Please sign in to comment.