mirror of
https://github.com/mempool/mempool.git
synced 2024-11-19 18:03:00 +01:00
Fix multiple mined RBF replacements of the same tx
This commit is contained in:
parent
eb8c38e4e8
commit
35d80eec1c
@ -91,6 +91,14 @@ export class Common {
|
|||||||
if (replaced.size) {
|
if (replaced.size) {
|
||||||
matches[tx.txid] = { replaced: Array.from(replaced), replacedBy: tx };
|
matches[tx.txid] = { replaced: Array.from(replaced), replacedBy: tx };
|
||||||
}
|
}
|
||||||
|
// remove this tx from the spendMap
|
||||||
|
// prevents the same tx being replaced more than once
|
||||||
|
for (const vin of tx.vin) {
|
||||||
|
const key = `${vin.txid}:${vin.vout}`;
|
||||||
|
if (spendMap.get(key)?.txid === tx.txid) {
|
||||||
|
spendMap.delete(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user