Skip to content

Commit 49cc66c

Browse files
authored
fix: update provider multiaddrs before dial (#286)
The output of `libp2p.contentRouting.findProviders()` is `AsyncIterable<{ id: PeerId, multiaddrs: Multiaddr[] }>` and not `AsyncIterable<PeerId>` as the code assumes.
1 parent fedc6db commit 49cc66c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/network.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class Network {
141141
async findAndConnect (cid, options) {
142142
const connectAttempts = []
143143
for await (const provider of this.findProviders(cid, CONSTANTS.maxProvidersPerRequest, options)) {
144-
this._log('connecting to providers', provider.id.toB58String())
145-
connectAttempts.push(this.connectTo(provider, options))
144+
this._log(`connecting to provider ${provider.id}`)
145+
connectAttempts.push(this.connectTo(provider.id, options))
146146
}
147147
await Promise.all(connectAttempts)
148148
}

0 commit comments

Comments
 (0)