diff options
author | glozow <gloriajzhao@gmail.com> | 2021-09-08 09:44:39 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-09-10 09:38:01 +0100 |
commit | c78eb8651b0949fefcafb22940512f4ef98d3358 (patch) | |
tree | cfc6c3ad0f4a7e1e5672a3d13972208cf4edf947 /src/policy/rbf.cpp | |
parent | 60881158c8010e436e3c107a2d62ffb7aa23220c (diff) |
[policy/refactor] pass in relay fee instead of using global
Diffstat (limited to 'src/policy/rbf.cpp')
-rw-r--r-- | src/policy/rbf.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/policy/rbf.cpp b/src/policy/rbf.cpp index 15527afb8a..cefc25a225 100644 --- a/src/policy/rbf.cpp +++ b/src/policy/rbf.cpp @@ -150,6 +150,7 @@ std::optional<std::string> PaysMoreThanConflicts(const CTxMemPool::setEntries& i std::optional<std::string> PaysForRBF(CAmount original_fees, CAmount replacement_fees, size_t replacement_vsize, + CFeeRate relay_fee, const uint256& txid) { // The replacement must pay greater fees than the transactions it @@ -163,11 +164,11 @@ std::optional<std::string> PaysForRBF(CAmount original_fees, // Finally in addition to paying more fees than the conflicts the // new transaction must pay for its own bandwidth. CAmount additional_fees = replacement_fees - original_fees; - if (additional_fees < ::incrementalRelayFee.GetFee(replacement_vsize)) { + if (additional_fees < relay_fee.GetFee(replacement_vsize)) { return strprintf("rejecting replacement %s, not enough additional fees to relay; %s < %s", txid.ToString(), FormatMoney(additional_fees), - FormatMoney(::incrementalRelayFee.GetFee(replacement_vsize))); + FormatMoney(relay_fee.GetFee(replacement_vsize))); } return std::nullopt; } |