mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
fees: add MemPoolFeeRateEstimator class
Add MemPoolFeeRateEstimator, which calls Bitcoin Core's block assembler with the mempool and chainstate to build a block template and use its chunk fee rates for fee rate estimation. Add CalculateMaxWeightPercentiles to return the 50th and 75th percentile chunk feerates by cumulative block weight. If sparse, EstimateFeeRate uses the higher of the minimum relay fee rate and the current mempool minimum fee rate. The 50th percentile is returned as the conservative estimate, and the 75th percentile as the economical estimate. Wire MemPoolFeeRateEstimator into FeeRateEstimatorManager and add FeeRateEstimatorType::MEMPOOL_POLICY for result attribution. Add unit tests for the mempool fee rate estimator and fee estimator string conversions, plus fuzz coverage for the string conversions. Co-authored-by: willcl-ark <will@256k1.dev>
This commit is contained in:
@@ -50,6 +50,7 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||
self.nodes[0].estimatesmartfee(1, 'unset')
|
||||
self.nodes[0].estimatesmartfee(1, 'conservative')
|
||||
self.nodes[0].estimatesmartfee(1, 'ECONOMICAL', {"fee_rate_estimator": "block_policy"})
|
||||
self.nodes[0].estimatesmartfee(1, 'ECONOMICAL', {"fee_rate_estimator": "mempool_policy"})
|
||||
self.nodes[0].estimatesmartfee(1, 'ECONOMICAL', {"fee_rate_estimator": "foo"})
|
||||
|
||||
self.nodes[0].estimaterawfee(1)
|
||||
|
||||
Reference in New Issue
Block a user