From d1e0495d70d681ee02dd33e34a23567415ac208e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 28 May 2024 16:51:22 +0200 Subject: [PATCH] p2p/discover: remove the node --- p2p/discover/table_reval.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/discover/table_reval.go b/p2p/discover/table_reval.go index d2c57504d1..60bdb8fca6 100644 --- a/p2p/discover/table_reval.go +++ b/p2p/discover/table_reval.go @@ -224,16 +224,16 @@ func (list *revalidationList) push(n *node, now mclock.AbsTime, rand randomSourc n.revalList = list } -func (list *revalidationList) remove(n *node) bool { +func (list *revalidationList) remove(n *node) { i := slices.Index(list.nodes, n) if i == -1 { - return false + panic(fmt.Errorf("node %v not found in list", n.ID())) } list.nodes = slices.Delete(list.nodes, i, i+1) + n.revalList = nil if len(list.nodes) == 0 { list.nextTime = never } - return true } func (list *revalidationList) contains(id enode.ID) bool {