diff --git a/src/utils/heads-exchange.ts b/src/utils/heads-exchange.ts index e73d32d5..553a8c45 100644 --- a/src/utils/heads-exchange.ts +++ b/src/utils/heads-exchange.ts @@ -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 @@ -181,6 +179,8 @@ export class HeadsExchange { this.writer.push({ filter: message }) + this.headsPromise = new DeferredPromise() + return this.headsPromise }