Merge pull request #5725 from mempool/mononaut/fix-partial-rbf

avoid creating incomplete RBF trees
This commit is contained in:
softsimon 2025-01-17 10:36:46 +07:00 committed by GitHub
commit 0d8f63feff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}