]> Sergey Matveev's repositories - btrtrc.git/commitdiff
dht: Avoid allocation(s) testing if an IP is blocked
authorMatt Joiner <anacrolix@gmail.com>
Mon, 30 Mar 2015 12:12:33 +0000 (23:12 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 30 Mar 2015 12:12:33 +0000 (23:12 +1100)
dht/getpeers.go

index 46ccd082691eb3f7dfb0836cb1101778d0a447e8..db221a64242895af14446aae3f979645defc47f5 100644 (file)
@@ -95,7 +95,7 @@ func (me *peerDiscovery) gotNodeAddr(addr dHTAddr) {
        if me.triedAddrs.Test([]byte(addr.String())) {
                return
        }
-       if me.server.ipBlocked(util.AddrIP(addr)) {
+       if me.server.ipBlocked(addr.UDPAddr().IP) {
                return
        }
        me.contact(addr)