mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
p2p/discover: remove the node
This commit is contained in:
parent
1fc3290b32
commit
d1e0495d70
1 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue