Skip to content

Commit

Permalink
Trigger events before identify
Browse files Browse the repository at this point in the history
  • Loading branch information
Menduist committed Mar 2, 2023
1 parent b07e66b commit c9cc2bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libp2p/dialer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ proc internalConnect(
raise newException(DialFailedError, "Unable to establish outgoing link")

try:
await self.peerStore.identify(muxed)
self.connManager.storeMuxer(muxed)
await self.peerStore.identify(muxed)
except CatchableError as exc:
trace "Failed to finish outgoung upgrade", err=exc.msg
await muxed.close()
Expand Down
2 changes: 1 addition & 1 deletion libp2p/switch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ proc mount*[T: LPProtocol](s: Switch, proto: T, matcher: Matcher = nil)

proc upgrader(switch: Switch, trans: Transport, conn: Connection) {.async.} =
let muxed = await trans.upgradeIncoming(conn)
await switch.peerStore.identify(muxed)
switch.connManager.storeMuxer(muxed)
await switch.peerStore.identify(muxed)
trace "Connection upgrade succeeded"

proc upgradeMonitor(
Expand Down

0 comments on commit c9cc2bc

Please sign in to comment.