mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-02-10 01:53:45 +00:00
Address review comments
This commit is contained in:
parent
454f658ba8
commit
77e866d29a
@ -199,7 +199,7 @@ proc dial*(s: Switch,
|
|||||||
let id = peer.id
|
let id = peer.id
|
||||||
trace "Dialing peer", peer = id
|
trace "Dialing peer", peer = id
|
||||||
result = s.connections.getOrDefault(id)
|
result = s.connections.getOrDefault(id)
|
||||||
if result == nil or result.closed:
|
if result.isNil or result.closed:
|
||||||
for t in s.transports: # for each transport
|
for t in s.transports: # for each transport
|
||||||
for a in peer.addrs: # for each address
|
for a in peer.addrs: # for each address
|
||||||
if t.handles(a): # check if it can dial it
|
if t.handles(a): # check if it can dial it
|
||||||
@ -210,7 +210,7 @@ proc dial*(s: Switch,
|
|||||||
result = await s.upgradeOutgoing(result)
|
result = await s.upgradeOutgoing(result)
|
||||||
result.closeEvent.wait().addCallback do (udata: pointer):
|
result.closeEvent.wait().addCallback do (udata: pointer):
|
||||||
asyncCheck s.cleanupConn(result)
|
asyncCheck s.cleanupConn(result)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
trace "Reusing existing connection"
|
trace "Reusing existing connection"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user