fees: remove careless override of -paytxfee in GetMinimumFee

This commit is contained in:
Patrick Lodder 2021-08-15 21:43:39 +02:00
parent 2370fc5701
commit 59f27ca73d
No known key found for this signature in database
GPG key ID: 2D3A345B98D0DC1F

View file

@ -2865,19 +2865,24 @@ CAmount CWallet::GetMinimumFee(const CMutableTransaction& tx, unsigned int nTxBy
CAmount nFeeNeeded = targetFee; CAmount nFeeNeeded = targetFee;
// User didn't set: use -txconfirmtarget to estimate... // User didn't set: use -txconfirmtarget to estimate...
if (nFeeNeeded == 0) { if (nFeeNeeded == 0) {
int estimateFoundTarget = nConfirmTarget; //int estimateFoundTarget = nConfirmTarget;
nFeeNeeded = pool.estimateSmartFee(nConfirmTarget, &estimateFoundTarget).GetFee(nTxBytes); //nFeeNeeded = pool.estimateSmartFee(nConfirmTarget, &estimateFoundTarget).GetFee(nTxBytes);
// ... unless we don't have enough mempool data for estimatefee, then use fallbackFee //// ... unless we don't have enough mempool data for estimatefee, then use fallbackFee
if (nFeeNeeded == 0) //if (nFeeNeeded == 0)
nFeeNeeded = fallbackFee.GetFee(nTxBytes); // nFeeNeeded = fallbackFee.GetFee(nTxBytes);
// Dogecoin: Drop the smart fee estimate, use GetRequiredFee
nFeeNeeded = GetRequiredFee(tx, nTxBytes);
} }
// prevent user from paying a fee below minRelayTxFee or minTxFee // prevent user from paying a fee below minRelayTxFee or minTxFee
// Dogecoin: Drop the smart fee estimate, use GetRequiredFee // Dogecoin: as we're adapting minTxFee to never be higher than
// nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(tx, nTxBytes)); // payTxFee unless explicitly set, this should be fine
nFeeNeeded = GetRequiredFee(tx, nTxBytes); nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(tx, nTxBytes));
// But always obey the maximum // But always obey the maximum
if (nFeeNeeded > maxTxFee) if (nFeeNeeded > maxTxFee)
nFeeNeeded = maxTxFee; nFeeNeeded = maxTxFee;
return nFeeNeeded; return nFeeNeeded;
} }