aboutsummaryrefslogtreecommitdiff
path: root/dht/routing_table.go
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2018-02-21 04:20:06 +0000
committerFelix Hanley <felix@userspace.com.au>2018-02-21 04:21:39 +0000
commite9adf3a2bf8b81615275a6705b7957e43753f0ec (patch)
tree1eaeb5081f3914a8ffa936d96ad1f1548c9aeb2f /dht/routing_table.go
parent020a8f9ec7e541d284ddb65111aafe42547927e5 (diff)
downloaddhtsearch-e9adf3a2bf8b81615275a6705b7957e43753f0ec.tar.gz
dhtsearch-e9adf3a2bf8b81615275a6705b7957e43753f0ec.tar.bz2
Seperate shared packages
Diffstat (limited to 'dht/routing_table.go')
-rw-r--r--dht/routing_table.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/dht/routing_table.go b/dht/routing_table.go
index 3c1f2d2..b10574c 100644
--- a/dht/routing_table.go
+++ b/dht/routing_table.go
@@ -73,10 +73,10 @@ func (k *routingTable) add(rn *remoteNode) {
k.Lock()
defer k.Unlock()
- if _, ok := k.addresses[rn.address.String()]; ok {
+ if _, ok := k.addresses[rn.addr.String()]; ok {
return
}
- k.addresses[rn.address.String()] = rn
+ k.addresses[rn.addr.String()] = rn
item := &rItem{
value: rn,
@@ -88,7 +88,7 @@ func (k *routingTable) add(rn *remoteNode) {
if len(k.items) > k.max {
for i := k.max - 1; i < len(k.items); i++ {
old := k.items[i]
- delete(k.addresses, old.value.address.String())
+ delete(k.addresses, old.value.addr.String())
heap.Remove(&k.items, i)
}
}