mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge pull request #6887
53238ffClarify what minrelaytxfee does (MarcoFalke)abd8b76[qt] Properly display required fee instead of minTxFee (MarcoFalke)
This commit is contained in:
@@ -2118,6 +2118,11 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
|
||||
return true;
|
||||
}
|
||||
|
||||
CAmount CWallet::GetRequiredFee(unsigned int nTxBytes)
|
||||
{
|
||||
return std::max(minTxFee.GetFee(nTxBytes), ::minRelayTxFee.GetFee(nTxBytes));
|
||||
}
|
||||
|
||||
CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool)
|
||||
{
|
||||
// payTxFee is user-set "I want to pay this much"
|
||||
@@ -2129,9 +2134,9 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarge
|
||||
if (nFeeNeeded == 0)
|
||||
nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes);
|
||||
// ... unless we don't have enough mempool data, in which case fall
|
||||
// back to a hard-coded fee
|
||||
// back to the required fee
|
||||
if (nFeeNeeded == 0)
|
||||
nFeeNeeded = minTxFee.GetFee(nTxBytes);
|
||||
nFeeNeeded = GetRequiredFee(nTxBytes);
|
||||
// prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee
|
||||
if (nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes))
|
||||
nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes);
|
||||
|
||||
Reference in New Issue
Block a user