From 822b05926f0738d749298395c90d3dd9d8675710 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 20 Apr 2024 10:31:51 +0200 Subject: [PATCH] p2p/discover: fix crash in move --- p2p/discover/table_reval.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/p2p/discover/table_reval.go b/p2p/discover/table_reval.go index 6a9d96fda2..185f152bf7 100644 --- a/p2p/discover/table_reval.go +++ b/p2p/discover/table_reval.go @@ -132,11 +132,10 @@ func (tr *tableRevalidation) handleResponse(tab *Table, resp revalidationRespons if !resp.didRespond { // Revalidation failed. n.livenessChecks /= 3 - if n.livenessChecks == 0 || resp.isNewNode { + if n.livenessChecks <= 0 { tab.deleteInBucket(b, n.ID()) - } - // Move to fast queue. - if !resp.isNewNode { + } else if !resp.isNewNode { + // Move to fast queue. tr.moveToList(&tr.fast, &tr.slow, n, now, &tab.rand) } return