mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
interfaces: Rename CalculateBumpFees methods to be compatible with capn'proto
This commit is contained in:
parent
156f49d682
commit
441d00c60f
4 changed files with 8 additions and 8 deletions
|
@ -244,7 +244,7 @@ public:
|
||||||
// outputs in the same transaction) or have shared ancestry, the bump fees are calculated
|
// outputs in the same transaction) or have shared ancestry, the bump fees are calculated
|
||||||
// independently, i.e. as if only one of them is spent. This may result in double-fee-bumping. This
|
// independently, i.e. as if only one of them is spent. This may result in double-fee-bumping. This
|
||||||
// caveat can be rectified per use of the sister-function CalculateCombinedBumpFee(…).
|
// caveat can be rectified per use of the sister-function CalculateCombinedBumpFee(…).
|
||||||
virtual std::map<COutPoint, CAmount> CalculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
|
virtual std::map<COutPoint, CAmount> calculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
|
||||||
|
|
||||||
//! Calculate the combined bump fee for an input set per the same strategy
|
//! Calculate the combined bump fee for an input set per the same strategy
|
||||||
// as in CalculateIndividualBumpFees(…).
|
// as in CalculateIndividualBumpFees(…).
|
||||||
|
@ -252,7 +252,7 @@ public:
|
||||||
// bump fees per outpoint, but a single bump fee for the shared ancestry.
|
// bump fees per outpoint, but a single bump fee for the shared ancestry.
|
||||||
// The combined bump fee may be used to correct overestimation due to
|
// The combined bump fee may be used to correct overestimation due to
|
||||||
// shared ancestry by multiple UTXOs after coin selection.
|
// shared ancestry by multiple UTXOs after coin selection.
|
||||||
virtual std::optional<CAmount> CalculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
|
virtual std::optional<CAmount> calculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
|
||||||
|
|
||||||
//! Get the node's package limits.
|
//! Get the node's package limits.
|
||||||
//! Currently only returns the ancestor and descendant count limits, but could be enhanced to
|
//! Currently only returns the ancestor and descendant count limits, but could be enhanced to
|
||||||
|
|
|
@ -671,7 +671,7 @@ public:
|
||||||
m_node.mempool->GetTransactionAncestry(txid, ancestors, descendants, ancestorsize, ancestorfees);
|
m_node.mempool->GetTransactionAncestry(txid, ancestors, descendants, ancestorsize, ancestorfees);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<COutPoint, CAmount> CalculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
std::map<COutPoint, CAmount> calculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
||||||
{
|
{
|
||||||
if (!m_node.mempool) {
|
if (!m_node.mempool) {
|
||||||
std::map<COutPoint, CAmount> bump_fees;
|
std::map<COutPoint, CAmount> bump_fees;
|
||||||
|
@ -683,7 +683,7 @@ public:
|
||||||
return MiniMiner(*m_node.mempool, outpoints).CalculateBumpFees(target_feerate);
|
return MiniMiner(*m_node.mempool, outpoints).CalculateBumpFees(target_feerate);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<CAmount> CalculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
std::optional<CAmount> calculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
||||||
{
|
{
|
||||||
if (!m_node.mempool) {
|
if (!m_node.mempool) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -86,7 +86,7 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CMutableTrans
|
||||||
reused_inputs.push_back(txin.prevout);
|
reused_inputs.push_back(txin.prevout);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<CAmount> combined_bump_fee = wallet.chain().CalculateCombinedBumpFee(reused_inputs, newFeerate);
|
std::optional<CAmount> combined_bump_fee = wallet.chain().calculateCombinedBumpFee(reused_inputs, newFeerate);
|
||||||
if (!combined_bump_fee.has_value()) {
|
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.")));
|
errors.push_back(strprintf(Untranslated("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ util::Result<PreSelectedInputs> FetchSelectedInputs(const CWallet& wallet, const
|
||||||
{
|
{
|
||||||
PreSelectedInputs result;
|
PreSelectedInputs result;
|
||||||
const bool can_grind_r = wallet.CanGrindR();
|
const bool can_grind_r = wallet.CanGrindR();
|
||||||
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().CalculateIndividualBumpFees(coin_control.ListSelected(), coin_selection_params.m_effective_feerate);
|
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().calculateIndividualBumpFees(coin_control.ListSelected(), coin_selection_params.m_effective_feerate);
|
||||||
for (const COutPoint& outpoint : coin_control.ListSelected()) {
|
for (const COutPoint& outpoint : coin_control.ListSelected()) {
|
||||||
int input_bytes = -1;
|
int input_bytes = -1;
|
||||||
CTxOut txout;
|
CTxOut txout;
|
||||||
|
@ -453,7 +453,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feerate.has_value()) {
|
if (feerate.has_value()) {
|
||||||
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().CalculateIndividualBumpFees(outpoints, feerate.value());
|
std::map<COutPoint, CAmount> map_of_bump_fees = wallet.chain().calculateIndividualBumpFees(outpoints, feerate.value());
|
||||||
|
|
||||||
for (auto& [_, outputs] : result.coins) {
|
for (auto& [_, outputs] : result.coins) {
|
||||||
for (auto& output : outputs) {
|
for (auto& output : outputs) {
|
||||||
|
@ -725,7 +725,7 @@ util::Result<SelectionResult> ChooseSelectionResult(interfaces::Chain& chain, co
|
||||||
outpoints.push_back(coin->outpoint);
|
outpoints.push_back(coin->outpoint);
|
||||||
summed_bump_fees += coin->ancestor_bump_fees;
|
summed_bump_fees += coin->ancestor_bump_fees;
|
||||||
}
|
}
|
||||||
std::optional<CAmount> combined_bump_fee = chain.CalculateCombinedBumpFee(outpoints, coin_selection_params.m_effective_feerate);
|
std::optional<CAmount> combined_bump_fee = chain.calculateCombinedBumpFee(outpoints, coin_selection_params.m_effective_feerate);
|
||||||
if (!combined_bump_fee.has_value()) {
|
if (!combined_bump_fee.has_value()) {
|
||||||
return util::Error{_("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")};
|
return util::Error{_("Failed to calculate bump fees, because unconfirmed UTXOs depend on enormous cluster of unconfirmed transactions.")};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue