From 4e13ef1aa204cedd699946eb595ee610584d0002 Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:54:06 +0200 Subject: [PATCH] Use `DEFAULT_MIN_RELAY_TX_FEE` as the minimum fee rate in GetMinFee() --- src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ab348d9237..ad36785616 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3817,13 +3817,16 @@ CAmount GetMinFee(const CTransaction& tx, unsigned int nTimeTx) CAmount GetMinFee(size_t nBytes, uint32_t nTime) { CAmount nMinFee; + CFeeRate nMinFeeRate; if (Params().GetConsensus().IsProtocolV3_1(nTime)) - nMinFee = (nBytes <= 100) ? MIN_TX_FEE : (CAmount)(nBytes * (TX_FEE_PER_KB / 1000)); + { + nMinFeeRate = CFeeRate(TX_FEE_PER_KB); + nMinFee = (nBytes <= 100) ? MIN_TX_FEE : nMinFeeRate.GetFee(nBytes); + } else { - nMinFee = ::minRelayTxFee.GetFee(nBytes); - if (nMinFee < DEFAULT_TRANSACTION_FEE) - nMinFee = DEFAULT_TRANSACTION_FEE; + nMinFeeRate = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE); + nMinFee = nMinFeeRate.GetFee(nBytes); } if (!MoneyRange(nMinFee))