From ff3535e8e03ea56207109f57ec3b4a30481d2fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 27 Apr 2021 21:47:59 +0300 Subject: [PATCH] p2p/tracker: only reschedule wake if previous didn't run --- p2p/tracker/tracker.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/p2p/tracker/tracker.go b/p2p/tracker/tracker.go index 19852ad6ab..69a49087e2 100644 --- a/p2p/tracker/tracker.go +++ b/p2p/tracker/tracker.go @@ -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)