Skip to content

Commit 8fa2936

Browse files
committed
[validation] re-introduce bool for whether a transaction is RBF
This bool was originally part of Workspace and was removed in #22539 when it was no longer needed in Finalize(). Re-introducing it because, once again, multiple functions will need to know whether we're doing an RBF. Member of MemPoolAccept so that we can use this to inform package RBF in the future.
1 parent cbb3598 commit 8fa2936

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/validation.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ class MemPoolAccept
568568
// in-mempool conflicts; see below).
569569
size_t m_limit_descendants;
570570
size_t m_limit_descendant_size;
571+
572+
/** Whether the transaction(s) would replace any mempool transactions. If so, RBF rules apply. */
573+
bool m_rbf{false};
571574
};
572575

573576
bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
@@ -808,8 +811,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
808811
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-spends-conflicting-tx", *err_string);
809812
}
810813

811-
812-
if (!setConflicts.empty()) {
814+
m_rbf = !setConflicts.empty();
815+
if (m_rbf) {
813816
CFeeRate newFeeRate(nModifiedFees, nSize);
814817
// It's possible that the replacement pays more fees than its direct conflicts but not more
815818
// than all conflicts (i.e. the direct conflicts have high-fee descendants). However, if the

0 commit comments

Comments
 (0)