Skip to content

Commit

Permalink
Merge pull request #57 from ChainSafe/cayman/bugfix
Browse files Browse the repository at this point in the history
Fix startup bugs in libp2p compat
  • Loading branch information
wemeetagain committed May 21, 2020
1 parent 5f0d36d commit ae97fa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libp2p/discv5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Discv5Discovery extends EventEmitter {
}
this.started = true;
await this.discv5.start();
setTimeout(() => this.findPeers, 1);
setTimeout(() => this.findPeers(), 1);
}

async stop(): Promise<void> {
Expand All @@ -61,7 +61,7 @@ export class Discv5Discovery extends EventEmitter {
}

async findPeers(): Promise<void> {
while (!this.started) {
while (this.started) {
// Search for random nodes
// emit discovered on all finds
const enrs = await this.discv5.findNode(createNodeId(randomBytes(32)));
Expand Down

0 comments on commit ae97fa4

Please sign in to comment.