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

Commit e8abf71

Browse files
committed
fix: dont create base conn when muxed exists
1 parent 88d0967 commit e8abf71

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dial.js

+7
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ class Dialer {
108108
*/
109109
_createBaseConnection (b58Id, callback) {
110110
const baseConnection = this.switch.conns[b58Id]
111+
const muxedConnection = this.switch.muxedConns[b58Id]
112+
113+
// if the muxed connection exists, dont return a connection,
114+
// _createMuxedConnection will get the connection
115+
if (muxedConnection) {
116+
return callback(null, null)
117+
}
111118
if (baseConnection) {
112119
this.switch.conns[b58Id] = undefined
113120
return callback(null, baseConnection)

0 commit comments

Comments
 (0)