Skip to content

Commit

Permalink
Merge pull request #114 from saul-jb/fix/heads-exchange-error
Browse files Browse the repository at this point in the history
fix: prevent the heads promise from throwing
  • Loading branch information
tabcat authored Feb 13, 2024
2 parents 36c3e46 + 59b592c commit 0a0ecb7
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 0a0ecb7

Please sign in to comment.