Skip to content

Commit

Permalink
fix: prevent the heads promise from throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
saul-jb committed Feb 12, 2024
1 parent 36c3e46 commit 59b592c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/heads-exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ export class HeadsExchange {
return this.headsPromise
}

this.headsPromise = new DeferredPromise()

const { filter, hashes } = createFilter(this.heads, {
seed: this.localSeed,
collisionRate: this.collisionRate
Expand All @@ -181,6 +179,8 @@ export class HeadsExchange {

this.writer.push({ filter: message })

this.headsPromise = new DeferredPromise()

return this.headsPromise
}

Expand Down

0 comments on commit 59b592c

Please sign in to comment.