Reduce core mempool tx sync to 8 concurrent requests

This commit is contained in:
Mononaut 2023-08-19 19:02:30 +09:00
parent 2a8a403da7
commit 2819cea509
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -75,7 +75,7 @@ class TransactionUtils {
public async $getMempoolTransactionsExtended(txids: string[], addPrevouts = false, lazyPrevouts = false, forceCore = false): Promise<MempoolTransactionExtended[]> {
if (forceCore || config.MEMPOOL.BACKEND !== 'esplora') {
const limiter = pLimit(32); // Run 32 requests at a time
const limiter = pLimit(8); // Run 8 requests at a time
const results = await Promise.allSettled(txids.map(
txid => limiter(() => this.$getMempoolTransactionExtended(txid, addPrevouts, lazyPrevouts, forceCore))
));