Skip to content

Commit

Permalink
chain: timeout poolsync
Browse files Browse the repository at this point in the history
  • Loading branch information
VandeurenGlenn committed Apr 26, 2024
1 parent 7757feb commit 6b0e1a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/chain/src/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ export default class Chain extends VersionControl {
} else if (!this.knownBlocks) this.knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
}

const peerTransactionPool = (higherThenCurrentLocal && (await this.getPeerTransactionPool(peer))) || []
if (this.#participating && peerTransactionPool.length > 0) return this.#runEpoch()
setTimeout(async () => {
const peerTransactionPool = (higherThenCurrentLocal && (await this.getPeerTransactionPool(peer))) || []
if (this.#participating && peerTransactionPool.length > 0) return this.#runEpoch()
}, 3000)
}

#epochTimeout
Expand Down

0 comments on commit 6b0e1a5

Please sign in to comment.