16 bool read_stale_estimates,
17 const fs::path& mempool_estimator_path,
28 if (!block_policy_estimate) {
30 return block_policy_estimate;
33 if (!mempool_estimate) {
37 return mempool_estimate;
39 auto selected_estimate = std::min(*block_policy_estimate, *mempool_estimate);
43 return selected_estimate;
The BlockPolicyEstimator is used for estimating the feerate needed for a transaction to be included i...
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
CAmount GetFeePerK() const
Return the fee in satoshis for a vsize of 1000 vbytes.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Interface for managing multiple Chainstate objects, where each chainstate is associated with chainsta...
std::unique_ptr< MemPoolFeeRateEstimator > m_mempool_estimator
unsigned int BlockPolicyHighestTargetTracked(FeeEstimateHorizon horizon) const
Returns the maximum supported confirmation target of block policy estimator.
virtual util::Expected< FeeRateEstimation, FeeRateEstimationError > GetFeeRateEstimate(int target, bool conservative) const
Get a fee rate estimate from the available fee rate estimators.
FeeRateEstimatorManager(const fs::path &block_policy_path, bool read_stale_estimates, const fs::path &mempool_estimator_path, const CTxMemPool &mempool, ChainstateManager &chainman)
std::vector< MinedBlockStats > MempoolPolicyEstimatorBlocksStats() const
Returns per-block weight statistics for the last MEMPOOL_HEALTH_WINDOW_BLOCKS mined blocks.
void IntervalFlush()
Flush recorded data to disk.
void MempoolTransactionsRemovedForBlock(const std::shared_ptr< const CBlock > &block, const std::vector< RemovedMempoolTransactionInfo > &txs_removed_for_block, unsigned int block_height) override
void TransactionRemovedFromMempool(const CTransactionRef &tx, MemPoolRemovalReason, uint64_t) override
Notifies listeners of a transaction leaving mempool.
virtual unsigned int MaximumTarget() const
Returns the maximum supported confirmation target from all fee rate estimators.
std::unique_ptr< CBlockPolicyEstimator > m_block_policy_estimator
CFeeRate BlockPolicyEstimateRawFee(unsigned int target, double threshold, FeeEstimateHorizon horizon, EstimationResult *buckets) const
Delegate to the block policy estimator's estimateRawFee (used by the estimaterawfee RPC).
void ShutdownFlush()
Flush recorded data to disk as part of shutdown sequence.
void TransactionAddedToMempool(const NewMempoolTransactionInfo &tx, uint64_t) override
Overridden from CValidationInterface.
virtual ~FeeRateEstimatorManager()
Estimate the fee rate required for a transaction to be included in the next block.
The util::Expected class provides a standard way for low-level functions to return either error value...
const std::string CURRENCY_ATOM
#define LogDebug(category,...)
MemPoolRemovalReason
Reason why a transaction was removed from the mempool, this is passed to the notification signal.
std::shared_ptr< const CTransaction > CTransactionRef
std::string_view FeeRateEstimatorTypeToString(FeeRateEstimatorType feerate_estimator_type)
FeeRateEstimatorType
Identifier for fee rate estimator.