Pavel Ševčík
3 years ago
No known key found for this signature in database
GPG Key ID: CFA54E4C0CD58DF0
1 changed files with
26 additions and
21 deletions
-
tracker/mempool-processor.js
|
|
@ -259,7 +259,10 @@ class MempoolProcessor { |
|
|
|
const unconfirmedTxs = await db.getUnconfirmedTransactions() |
|
|
|
|
|
|
|
if (unconfirmedTxs.length > 0) { |
|
|
|
await util.parallelCall(unconfirmedTxs, tx => { |
|
|
|
const unconfirmedTxLists = util.splitList(unconfirmedTxs, 10) |
|
|
|
|
|
|
|
await util.seriesCall(unconfirmedTxLists, async (txList) => { |
|
|
|
return await util.parallelCall(txList, tx => { |
|
|
|
try { |
|
|
|
return this.client.getrawtransaction( { txid: tx.txnTxid, verbose: true }) |
|
|
|
.then(async rtx => { |
|
|
@ -271,7 +274,8 @@ class MempoolProcessor { |
|
|
|
return db.confirmTransactions([tx.txnTxid], block.blockID) |
|
|
|
} |
|
|
|
}, |
|
|
|
() => { |
|
|
|
(e) => { |
|
|
|
Logger.error(e, 'Tracker : MempoolProcessor.checkUnconfirmed()') |
|
|
|
// Transaction not in mempool. Update LRU cache and database
|
|
|
|
TransactionsBundle.cache.del(tx.txnTxid) |
|
|
|
// TODO: Notify clients of orphaned transaction
|
|
|
@ -282,6 +286,7 @@ class MempoolProcessor { |
|
|
|
Logger.error(e, 'Tracker : MempoolProcessor.checkUnconfirmed()') |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// Logs
|
|
|
|