Skip to content

Commit

Permalink
fix: prepend connection addr to circuit relay address (#1355)
Browse files Browse the repository at this point in the history
Otherwise the reported remote addr is not valid
  • Loading branch information
achingbrain committed Aug 15, 2022
1 parent 886759b commit 509e56a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/circuit/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ export class Circuit implements Transport, Initializable {
}

if (virtualConnection != null) {
// @ts-expect-error dst peer will not be undefined
const remoteAddr = new Multiaddr(request.dstPeer.addrs[0])
// @ts-expect-error dst peer will not be undefined
const localAddr = new Multiaddr(request.srcPeer.addrs[0])
const remoteAddr = connection.remoteAddr
.encapsulate('/p2p-circuit')
.encapsulate(new Multiaddr(request.dstPeer?.addrs[0]))
const localAddr = new Multiaddr(request.srcPeer?.addrs[0])
const maConn = streamToMaConnection({
stream: virtualConnection,
remoteAddr,
Expand Down

0 comments on commit 509e56a

Please sign in to comment.