aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-19 11:09:59 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-09-05 11:44:25 +0200
commitfa831684e54783f6b40533ca218eb7636bdae667 (patch)
tree7b016530828cf75ca24592efab81edaa96403649 /src/policy
parentdf75e9f3ee4de2b841fe0e84514b58a4e630d258 (diff)
downloadbitcoin-fa831684e54783f6b40533ca218eb7636bdae667.tar.xz
refactor: Add IsRBFOptInEmptyMempool
Co-authored-by: John Newbery <jonnynewbs@gmail.com>
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/rbf.cpp6
-rw-r--r--src/policy/rbf.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/policy/rbf.cpp b/src/policy/rbf.cpp
index f8b17d18d5..4b55934891 100644
--- a/src/policy/rbf.cpp
+++ b/src/policy/rbf.cpp
@@ -36,3 +36,9 @@ RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool)
}
return RBFTransactionState::FINAL;
}
+
+RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx)
+{
+ // If we don't have a local mempool we can only check the transaction itself.
+ return SignalsOptInRBF(tx) ? RBFTransactionState::REPLACEABLE_BIP125 : RBFTransactionState::UNKNOWN;
+}
diff --git a/src/policy/rbf.h b/src/policy/rbf.h
index d335fbbb36..463c5b61e6 100644
--- a/src/policy/rbf.h
+++ b/src/policy/rbf.h
@@ -18,5 +18,6 @@ enum class RBFTransactionState {
// This involves checking sequence numbers of the transaction, as well
// as the sequence numbers of all in-mempool ancestors.
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
+RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);
#endif // BITCOIN_POLICY_RBF_H