aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-10-28 13:25:23 +0100
committerglozow <gloriajzhao@gmail.com>2021-10-28 15:58:54 +0100
commit8fa2936b34fda9c0bea963311fa80a04b4bf5867 (patch)
treefb848595955dfb27749b169bdeab1411f2a525c6 /src/validation.cpp
parentcbb3598b5ce2bea58a8cb1ad2167d7d1d079acf7 (diff)
downloadbitcoin-8fa2936b34fda9c0bea963311fa80a04b4bf5867.tar.xz
[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.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 841aaebe0e..c32309b214 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -568,6 +568,9 @@ private:
// in-mempool conflicts; see below).
size_t m_limit_descendants;
size_t m_limit_descendant_size;
+
+ /** Whether the transaction(s) would replace any mempool transactions. If so, RBF rules apply. */
+ bool m_rbf{false};
};
bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
@@ -808,8 +811,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
return state.Invalid(TxValidationResult::TX_CONSENSUS, "bad-txns-spends-conflicting-tx", *err_string);
}
-
- if (!setConflicts.empty()) {
+ m_rbf = !setConflicts.empty();
+ if (m_rbf) {
CFeeRate newFeeRate(nModifiedFees, nSize);
// It's possible that the replacement pays more fees than its direct conflicts but not more
// than all conflicts (i.e. the direct conflicts have high-fee descendants). However, if the