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 {
// 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