diff options
author | glozow <gloriajzhao@gmail.com> | 2021-08-11 15:51:41 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-09-02 16:23:27 +0100 |
commit | ac761f0a23c9c469fa00885edf3d5c9ae7c6a2b3 (patch) | |
tree | 02267b82f3a9754be5d06e6769b1f8d70c129af4 /src/policy/rbf.h | |
parent | 9c2f9f89846264b503d5573341bb78cf609cbc5e (diff) | |
download | bitcoin-ac761f0a23c9c469fa00885edf3d5c9ae7c6a2b3.tar.xz |
MOVEONLY: fee checks (Rules 3 and 4) to policy/rbf
Diffstat (limited to 'src/policy/rbf.h')
-rw-r--r-- | src/policy/rbf.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/policy/rbf.h b/src/policy/rbf.h index 2c548152b5..d32ba010fb 100644 --- a/src/policy/rbf.h +++ b/src/policy/rbf.h @@ -78,4 +78,18 @@ std::optional<std::string> EntriesAndTxidsDisjoint(const CTxMemPool::setEntries& std::optional<std::string> PaysMoreThanConflicts(const CTxMemPool::setEntries& setIterConflicting, CFeeRate newFeeRate, const uint256& hash); +/** Enforce BIP125 Rule #3 "The replacement transaction pays an absolute fee of at least the sum + * paid by the original transactions." Enforce BIP125 Rule #4 "The replacement transaction must also + * pay for its own bandwidth at or above the rate set by the node's minimum relay fee setting." + * @param[in] nConflictingFees Total modified fees of original transaction(s). + * @param[in] nModifiedFees Total modified fees of replacement transaction(s). + * @param[in] nSize Total virtual size of replacement transaction(s). + * @param[in] hash Transaction ID, included in the error message if violation occurs. + * @returns error string if fees are insufficient, otherwise std::nullopt. + */ +std::optional<std::string> PaysForRBF(CAmount nConflictingFees, + CAmount nModifiedFees, + size_t nSize, + const uint256& hash); + #endif // BITCOIN_POLICY_RBF_H |