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

Commit

Permalink
fix: dont create base conn when muxed exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun committed May 1, 2018
1 parent fa47dd1 commit 87b51a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dial.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ class Dialer {
*/
_createBaseConnection (b58Id, callback) {
const baseConnection = this.switch.conns[b58Id]
const muxedConnection = this.switch.muxedConns[b58Id]

// if the muxed connection exists, dont return a connection,
// _createMuxedConnection will get the connection
if (muxedConnection) {
return callback(null, null)
}
if (baseConnection) {
this.switch.conns[b58Id] = undefined
return callback(null, baseConnection)
Expand Down

0 comments on commit 87b51a9

Please sign in to comment.