mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
[node] interface to get bump fees
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <node/coin.h>
|
||||
#include <node/context.h>
|
||||
#include <node/interface_ui.h>
|
||||
#include <node/mini_miner.h>
|
||||
#include <node/transaction.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <policy/fees.h>
|
||||
@@ -665,6 +666,26 @@ public:
|
||||
if (!m_node.mempool) return;
|
||||
m_node.mempool->GetTransactionAncestry(txid, ancestors, descendants, ancestorsize, ancestorfees);
|
||||
}
|
||||
|
||||
std::map<COutPoint, CAmount> CalculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
||||
{
|
||||
if (!m_node.mempool) {
|
||||
std::map<COutPoint, CAmount> bump_fees;
|
||||
for (const auto& outpoint : outpoints) {
|
||||
bump_fees.emplace(std::make_pair(outpoint, 0));
|
||||
}
|
||||
return bump_fees;
|
||||
}
|
||||
return MiniMiner(*m_node.mempool, outpoints).CalculateBumpFees(target_feerate);
|
||||
}
|
||||
|
||||
std::optional<CAmount> CalculateCombinedBumpFee(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) override
|
||||
{
|
||||
if (!m_node.mempool) {
|
||||
return 0;
|
||||
}
|
||||
return MiniMiner(*m_node.mempool, outpoints).CalculateTotalBumpFees(target_feerate);
|
||||
}
|
||||
void getPackageLimits(unsigned int& limit_ancestor_count, unsigned int& limit_descendant_count) override
|
||||
{
|
||||
const CTxMemPool::Limits default_limits{};
|
||||
|
||||
Reference in New Issue
Block a user