p2p/discover: fix crash in move

This commit is contained in:
Felix Lange 2024-04-20 10:31:51 +02:00
parent b44673fa29
commit 822b05926f

View file

@ -132,11 +132,10 @@ func (tr *tableRevalidation) handleResponse(tab *Table, resp revalidationRespons
if !resp.didRespond { if !resp.didRespond {
// Revalidation failed. // Revalidation failed.
n.livenessChecks /= 3 n.livenessChecks /= 3
if n.livenessChecks == 0 || resp.isNewNode { if n.livenessChecks <= 0 {
tab.deleteInBucket(b, n.ID()) tab.deleteInBucket(b, n.ID())
} } else if !resp.isNewNode {
// Move to fast queue. // Move to fast queue.
if !resp.isNewNode {
tr.moveToList(&tr.fast, &tr.slow, n, now, &tab.rand) tr.moveToList(&tr.fast, &tr.slow, n, now, &tab.rand)
} }
return return