From 1583e2acc9d16fdd03497e4c7bad4a2b80b1308e Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Wed, 13 Mar 2019 11:48:38 +0000 Subject: [PATCH] fix: incoming message should not connect to peers --- src/message/index.js | 5 ----- test/message.spec.js | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/message/index.js b/src/message/index.js index 7c045c92..74e9ec50 100644 --- a/src/message/index.js +++ b/src/message/index.js @@ -116,11 +116,6 @@ function fromPbPeer (peer) { const info = new PeerInfo(new PeerId(peer.id)) peer.addrs.forEach((a) => info.multiaddrs.add(a)) - // TODO: upgrade protobuf to send the address connected on - if (peer.connection === CONNECTION_TYPE.CONNECTED) { - info.connect(peer.addrs[0]) - } - return info } diff --git a/test/message.spec.js b/test/message.spec.js index f38a3f33..224edf77 100644 --- a/test/message.spec.js +++ b/test/message.spec.js @@ -71,8 +71,6 @@ describe('Message', () => { expect(peer.id.isEqual(msg.closerPeers[i].id)).to.eql(true) expect(peer.multiaddrs.toArray()) .to.eql(msg.closerPeers[i].multiaddrs.toArray()) - - expect(peer.isConnected()).to.eql(peer.multiaddrs.toArray()[0]) }) expect(dec.providerPeers).to.have.length(5)