Skip to content

Commit b669aac

Browse files
committed
feat: update network calls to use dialProtocol instead
1 parent 851a731 commit b669aac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/network.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ class Network {
163163
// Dial to the peer and try to use the most recent Bitswap
164164
_dialPeer (peer, callback) {
165165
// Attempt Bitswap 1.1.0
166-
this.libp2p.dial(peer, BITSWAP110, (err, conn) => {
166+
this.libp2p.dialProtocol(peer, BITSWAP110, (err, conn) => {
167167
if (err) {
168168
// Attempt Bitswap 1.0.0
169-
this.libp2p.dial(peer, BITSWAP100, (err, conn) => {
169+
this.libp2p.dialProtocol(peer, BITSWAP100, (err, conn) => {
170170
if (err) { return callback(err) }
171171

172172
callback(null, conn, BITSWAP100)

test/network/network.node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ describe('network', () => {
186186
expect(err).to.not.exist()
187187
}
188188

189-
p2pA.dial(p2pB.peerInfo, '/ipfs/bitswap/1.0.0', (err, conn) => {
189+
p2pA.dialProtocol(p2pB.peerInfo, '/ipfs/bitswap/1.0.0', (err, conn) => {
190190
expect(err).to.not.exist()
191191

192192
pull(
@@ -219,7 +219,7 @@ describe('network', () => {
219219
expect(err).to.not.exist()
220220
}
221221

222-
p2pA.dial(p2pB.peerInfo, '/ipfs/bitswap/1.1.0', (err, conn) => {
222+
p2pA.dialProtocol(p2pB.peerInfo, '/ipfs/bitswap/1.1.0', (err, conn) => {
223223
expect(err).to.not.exist()
224224

225225
pull(

0 commit comments

Comments
 (0)