From 1fc3290b32cc55a9ce4fb4170c6029ff784c0629 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 28 May 2024 16:46:51 +0200 Subject: [PATCH] p2p/discover: add sanity check --- p2p/discover/table_reval.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/p2p/discover/table_reval.go b/p2p/discover/table_reval.go index eddb6ff1c1..d2c57504d1 100644 --- a/p2p/discover/table_reval.go +++ b/p2p/discover/table_reval.go @@ -59,9 +59,10 @@ func (tr *tableRevalidation) nodeAdded(tab *Table, n *node) { // nodeRemoved is called when a node was removed from the table. func (tr *tableRevalidation) nodeRemoved(n *node) { - if n.revalList != nil { - n.revalList.remove(n) + if n.revalList == nil { + panic(fmt.Errorf("removed node %v has nil revalList", n.ID())) } + n.revalList.remove(n) } // run performs node revalidation.