Skip to content

Commit 441d00c

Browse files
committed
interfaces: Rename CalculateBumpFees methods to be compatible with capn'proto
1 parent 156f49d commit 441d00c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/interfaces/chain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ class Chain
244244
// outputs in the same transaction) or have shared ancestry, the bump fees are calculated
245245
// independently, i.e. as if only one of them is spent. This may result in double-fee-bumping. This
246246
// caveat can be rectified per use of the sister-function CalculateCombinedBumpFee(…).
247-
virtual std::map<COutPoint, CAmount> CalculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
247+
virtual std::map<COutPoint, CAmount> calculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
248248

249249
//! Calculate the combined bump fee for an input set per the same strategy
250250
// as in CalculateIndividualBumpFees(…).
251251
// Unlike CalculateIndividualBumpFees(…), this does not return individual
252252
// bump fees per outpoint, but a single bump fee for the shared ancestry.
253253
// The combined bump fee may be used to correct overestimation due to
254254
// shared ancestry by multiple UTXOs after coin selection.
255-
virtual std::optional<CAmount> CalculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
255+
virtual std::optional<CAmount> calculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
256256

257257
//! Get the node's package limits.
258258
//! Currently only returns the ancestor and descendant count limits, but could be enhanced to

src/node/interfaces.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ class ChainImpl : public Chain
671671
m_node.mempool->GetTransactionAncestry(txid, ancestors, descendants, ancestorsize, ancestorfees);
672672
}
673673

674-
std::map<COutPoint, CAmount> CalculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
674+
std::map<COutPoint, CAmount> calculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
675675
{
676676
if (!m_node.mempool) {
677677
std::map<COutPoint, CAmount> bump_fees;
@@ -683,7 +683,7 @@ class ChainImpl : public Chain
683683
return MiniMiner(*m_node.mempool, outpoints).CalculateBumpFees(target_feerate);
684684
}
685685

686-
std::optional<CAmount> CalculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
686+
std::optional<CAmount> calculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
687687
{
688688
if (!m_node.mempool) {
689689
return 0;

src/wallet/feebumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CMutableTrans
8686
reused_inputs.push_back(txin.prevout);
8787
}
8888

89-
std::optional<CAmount> combined_bump_fee = wallet.chain().CalculateCombinedBumpFee(reused_inputs, newFeerate);
89+
std::optional<CAmount> combined_bump_fee = wallet.chain().calculateCombinedBumpFee(reused_inputs, newFeerate);
9090
if (!combined_bump_fee.has_value()) {
9191
errors.push_back(strprintf(Untranslated("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")));
9292
}

src/wallet/spend.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ util::Result<PreSelectedInputs> FetchSelectedInputs(const CWallet& wallet, const
259259
{
260260
PreSelectedInputs result;
261261
const bool can_grind_r = wallet.CanGrindR();
262-
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().CalculateIndividualBumpFees(coin_control.ListSelected(), coin_selection_params.m_effective_feerate);
262+
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().calculateIndividualBumpFees(coin_control.ListSelected(), coin_selection_params.m_effective_feerate);
263263
for (const COutPoint& outpoint : coin_control.ListSelected()) {
264264
int input_bytes = -1;
265265
CTxOut txout;
@@ -453,7 +453,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
453453
}
454454

455455
if (feerate.has_value()) {
456-
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().CalculateIndividualBumpFees(outpoints, feerate.value());
456+
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().calculateIndividualBumpFees(outpoints, feerate.value());
457457

458458
for (auto& [_, outputs] : result.coins) {
459459
for (auto& output : outputs) {
@@ -725,7 +725,7 @@ util::Result<SelectionResult> ChooseSelectionResult(interfaces::Chain& chain, co
725725
outpoints.push_back(coin->outpoint);
726726
summed_bump_fees += coin->ancestor_bump_fees;
727727
}
728-
std::optional<CAmount> combined_bump_fee = chain.CalculateCombinedBumpFee(outpoints, coin_selection_params.m_effective_feerate);
728+
std::optional<CAmount> combined_bump_fee = chain.calculateCombinedBumpFee(outpoints, coin_selection_params.m_effective_feerate);
729729
if (!combined_bump_fee.has_value()) {
730730
return util::Error{_("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")};
731731
}

0 commit comments

Comments
 (0)