Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/fees.cpp
Show All 27 Lines | if (nFeeNeeded == Amount::zero()) { | ||||
} | } | ||||
} | } | ||||
// Prevent user from paying a fee below minRelayTxFee or minTxFee. | // Prevent user from paying a fee below minRelayTxFee or minTxFee. | ||||
nFeeNeeded = | nFeeNeeded = | ||||
std::max(nFeeNeeded, GetConfig().GetMinFeePerKB().GetFee(nTxBytes)); | std::max(nFeeNeeded, GetConfig().GetMinFeePerKB().GetFee(nTxBytes)); | ||||
// But always obey the maximum. | // But always obey the maximum. | ||||
if (nFeeNeeded > maxTxFee) { | Amount maxFee = GetConfig().GetMaxFee(); | ||||
nFeeNeeded = maxTxFee; | if (nFeeNeeded > maxFee) { | ||||
nFeeNeeded = maxFee; | |||||
} | } | ||||
return nFeeNeeded; | return nFeeNeeded; | ||||
} | } | ||||
Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, | Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, | ||||
const CTxMemPool &pool) { | const CTxMemPool &pool) { | ||||
// payTxFee is the user-set global for desired feerate. | // payTxFee is the user-set global for desired feerate. | ||||
return GetMinimumFee(nTxBytes, nConfirmTarget, pool, | return GetMinimumFee(nTxBytes, nConfirmTarget, pool, | ||||
payTxFee.GetFeeCeiling(nTxBytes)); | payTxFee.GetFeeCeiling(nTxBytes)); | ||||
} | } | ||||
No newline at end of file | No newline at end of file |