Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
fix: connection establishment event handling (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and jacobheun committed Jan 2, 2019
1 parent b2698fd commit c27c344
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class Circuit {

this.dialer = new CircuitDialer(swarm, options)

this.swarm.on('peer-mux-established', this.dialer.canHop.bind(this.dialer))
this.swarm.on('peer-mux-established', (peerInfo) => {
this.dialer.canHop(peerInfo)
})
this.swarm.on('peer-mux-closed', (peerInfo) => {
this.dialer.relayPeers.delete(peerInfo.id.toB58String())
})
Expand Down

0 comments on commit c27c344

Please sign in to comment.