p2p/discover: add sanity check

This commit is contained in:
Felix Lange 2024-05-28 16:46:51 +02:00
parent 094dd6e16a
commit 1fc3290b32

View file

@ -59,9 +59,10 @@ func (tr *tableRevalidation) nodeAdded(tab *Table, n *node) {
// nodeRemoved is called when a node was removed from the table. // nodeRemoved is called when a node was removed from the table.
func (tr *tableRevalidation) nodeRemoved(n *node) { func (tr *tableRevalidation) nodeRemoved(n *node) {
if n.revalList != nil { if n.revalList == nil {
n.revalList.remove(n) panic(fmt.Errorf("removed node %v has nil revalList", n.ID()))
} }
n.revalList.remove(n)
} }
// run performs node revalidation. // run performs node revalidation.