avoid creating incomplete RBF trees

This commit is contained in:
Mononaut 2025-01-14 06:41:34 +00:00
parent 0a255d7fe5
commit 4dcbccd9b2
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -119,7 +119,11 @@ class RbfCache {
public add(replaced: MempoolTransactionExtended[], newTxExtended: MempoolTransactionExtended): void {
if (!newTxExtended || !replaced?.length || this.txs.has(newTxExtended.txid)) {
if ( !newTxExtended
|| !replaced?.length
|| this.txs.has(newTxExtended.txid)
|| !(replaced.some(tx => !this.replacedBy.has(tx.txid)))
) {
return;
}