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 ff829fc43e
commit d18c6eca83
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) {
// Note: this overrides any other peer discover
libp2pOpts.modules = Object.assign(libp2pOpts.modules, {
peerDiscovery: [Bootstrap],
});
try {
const list = await bootstrap();
// Note: this overrides any other peer discover
libp2pOpts.modules = Object.assign(libp2pOpts.modules, {
peerDiscovery: [Bootstrap],
});
libp2pOpts.config.peerDiscovery = {
[Bootstrap.tag]: {
list,