aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-30 23:23:28 +0800
committerFelix Lange <fjl@twurst.com>2015-04-01 23:00:12 +0800
commita77c431e378a3cfcddb4b33317319412799c96cb (patch)
treeaa8a0bcf1715eac248954748de2648bcdb07fd88 /p2p/discover/table.go
parentde7af720d6bb10b93d716fb0c6cf3ee0e51dc71a (diff)
downloadgo-tangerine-a77c431e378a3cfcddb4b33317319412799c96cb.tar.gz
go-tangerine-a77c431e378a3cfcddb4b33317319412799c96cb.tar.zst
go-tangerine-a77c431e378a3cfcddb4b33317319412799c96cb.zip
p2p/discover: fix off by one error causing buckets to contain duplicates
Diffstat (limited to 'p2p/discover/table.go')
-rw-r--r--p2p/discover/table.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discover/table.go b/p2p/discover/table.go
index 842f55d9f..dbf86c084 100644
--- a/p2p/discover/table.go
+++ b/p2p/discover/table.go
@@ -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
}