aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table_util_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/discover/table_util_test.go')
-rw-r--r--p2p/discover/table_util_test.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go
index 3ce582b99..e61c9e6fc 100644
--- a/p2p/discover/table_util_test.go
+++ b/p2p/discover/table_util_test.go
@@ -86,17 +86,8 @@ func fillBucket(tab *Table, n *node) (last *node) {
// fillTable adds nodes the table to the end of their corresponding bucket
// if the bucket is not full. The caller must not hold tab.mutex.
func fillTable(tab *Table, nodes []*node) {
- tab.mutex.Lock()
- defer tab.mutex.Unlock()
-
for _, n := range nodes {
- if n.ID() == tab.self().ID() {
- continue // don't add self
- }
- b := tab.bucket(n.ID())
- if len(b.entries) < bucketSize {
- tab.bumpOrAdd(b, n)
- }
+ tab.addSeenNode(n)
}
}
@@ -154,15 +145,6 @@ func hasDuplicates(slice []*node) bool {
return false
}
-func contains(ns []*node, id enode.ID) bool {
- for _, n := range ns {
- if n.ID() == id {
- return true
- }
- }
- return false
-}
-
func sortedByDistanceTo(distbase enode.ID, slice []*node) bool {
var last enode.ID
for i, e := range slice {