make adding transactions to cluster mempool idempotent

This commit is contained in:
mononaut 2026-06-03 08:55:49 +00:00
parent b3bfdd8c26
commit 46f54061db
No known key found for this signature in database
GPG key ID: BFD16BE592A9CD8D

View file

@ -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);