mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
make adding transactions to cluster mempool idempotent
This commit is contained in:
parent
b3bfdd8c26
commit
46f54061db
1 changed files with 6 additions and 0 deletions
|
|
@ -431,6 +431,12 @@ export class ClusterMempool {
|
|||
for (const tx of added) {
|
||||
const txid = tx.txid;
|
||||
|
||||
// sanity check for duplicate transactions
|
||||
if (this.getClusterForTx(txid) !== null) {
|
||||
logger.warn(`ClusterMempool.processAdditions: ${txid} was already added, skipping`);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const vin of tx.vin) {
|
||||
if (!vin.is_coinbase) {
|
||||
this.spentBy.set(`${vin.txid}:${vin.vout}`, txid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue