From bccffd6ace53c2580eb52f268b4a462436ad13c7 Mon Sep 17 00:00:00 2001 From: Pedro Teixeira Date: Thu, 6 Jul 2017 16:20:25 +0100 Subject: [PATCH] fix: _dialPeer always calls back --- src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 49bce84..3cfeeba 100644 --- a/src/index.js +++ b/src/index.js @@ -67,12 +67,13 @@ class FloodSub extends EventEmitter { // If already have a PubSub conn, ignore const peer = this.peers.get(idB58Str) if (peer && peer.isConnected) { - return + return callback() } this.libp2p.dial(peerInfo, multicodec, (err, conn) => { if (err) { - return log.err(err) + log.err(err) + return callback() } this._onDial(peerInfo, conn, callback)