p2p/discover: fix off by one error causing buckets to contain duplicates
This commit is contained in:
@ -328,7 +328,7 @@ func (b *bucket) bump(n *Node) bool {
|
||||
if b.entries[i].ID == n.ID {
|
||||
n.bumpActive()
|
||||
// move it to the front
|
||||
copy(b.entries[1:], b.entries[:i+1])
|
||||
copy(b.entries[1:], b.entries[:i])
|
||||
b.entries[0] = n
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user