Do not setup libp2p discovery module if we fail to retrieve node addrs

This commit is contained in:
Franck Royer 2021-09-21 14:22:23 +10:00
parent a95315eeb5
commit 640a672257
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 5 deletions

View File

@ -202,14 +202,14 @@ export class Waku {
} }
if (bootstrap !== undefined) { if (bootstrap !== undefined) {
// Note: this overrides any other peer discover
libp2pOpts.modules = Object.assign(libp2pOpts.modules, {
peerDiscovery: [Bootstrap],
});
try { try {
const list = await bootstrap(); const list = await bootstrap();
// Note: this overrides any other peer discover
libp2pOpts.modules = Object.assign(libp2pOpts.modules, {
peerDiscovery: [Bootstrap],
});
libp2pOpts.config.peerDiscovery = { libp2pOpts.config.peerDiscovery = {
[Bootstrap.tag]: { [Bootstrap.tag]: {
list, list,