mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Amend bumpfee for inputs with overlapping ancestry
At the end of coin selection reduce the fees by the difference between the individual bump fee estimates and the collective bump fee estimate.
This commit is contained in:
@@ -86,13 +86,11 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CMutableTrans
|
||||
reused_inputs.push_back(txin.prevout);
|
||||
}
|
||||
|
||||
std::map<COutPoint, CAmount> bump_fees = wallet.chain().CalculateIndividualBumpFees(reused_inputs, newFeerate);
|
||||
CAmount total_bump_fees = 0;
|
||||
for (auto& [_, bump_fee] : bump_fees) {
|
||||
total_bump_fees += bump_fee;
|
||||
std::optional<CAmount> combined_bump_fee = wallet.chain().CalculateCombinedBumpFee(reused_inputs, newFeerate);
|
||||
if (!combined_bump_fee.has_value()) {
|
||||
errors.push_back(strprintf(Untranslated("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")));
|
||||
}
|
||||
|
||||
CAmount new_total_fee = newFeerate.GetFee(maxTxSize) + total_bump_fees;
|
||||
CAmount new_total_fee = newFeerate.GetFee(maxTxSize) + combined_bump_fee.value();
|
||||
|
||||
CFeeRate incrementalRelayFee = std::max(wallet.chain().relayIncrementalFee(), CFeeRate(WALLET_INCREMENTAL_RELAY_FEE));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user