This repository was archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
dht.provide fails if any closest peer is blacklisted #105
Copy link
Copy link
Open
Description
reproduction / error flow
- get peer blacklisted somehow
- call dht.provide()
- blacklisted peer in getClosestPeers
async/eachover peers and callthis.network.sendMessage(peer, msg, cb)- blacklist error causes whole
async/eachto end with error
js-libp2p-kad-dht/src/index.js
Lines 530 to 542 in 9db17eb
| waterfall([ | |
| (cb) => this.providers.addProvider(key, this.peerInfo.id, cb), | |
| (cb) => this.getClosestPeers(key.buffer, cb), | |
| (peers, cb) => { | |
| const msg = new Message(Message.TYPES.ADD_PROVIDER, key.buffer, 0) | |
| msg.providerPeers = peers.map((p) => new PeerInfo(p)) | |
| each(peers, (peer, cb) => { | |
| this._log('putProvider %s to %s', key.toBaseEncodedString(), peer.toB58String()) | |
| this.network.sendMessage(peer, msg, cb) | |
| }, cb) | |
| } | |
| ], (err) => callback(err)) |
suggestions:
- ignore all errors?
- filter peers by not-blacklisted before async/each => sendMessage
Metadata
Metadata
Assignees
Labels
No labels