Skip to content

Commit

Permalink
Use DEFAULT_MIN_RELAY_TX_FEE as the minimum fee rate in GetMinFee()
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Aug 12, 2023
1 parent 06b358b commit 4e13ef1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 4e13ef1

Please sign in to comment.