Skip to content

Commit 0d3fc9e

Browse files
committed
Pass fee estimator into CTxMempool
This partially reverts commit 7145239.
1 parent 181dada commit 0d3fc9e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15451545
assert(!node.chainman);
15461546

15471547
CTxMemPool::Options mempool_opts{
1548+
.estimator = node.fee_estimator.get(),
15481549
.check_ratio = chainparams.DefaultConsistencyChecks() ? 1 : 0,
15491550
.signals = &validation_signals,
15501551
};

src/kernel/mempool_options.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <cstdint>
1414
#include <optional>
1515

16+
class CBlockPolicyEstimator;
1617
class ValidationSignals;
1718

1819
enum class RBFPolicy { Never, OptIn, Always };
@@ -42,6 +43,8 @@ namespace kernel {
4243
* Most of the time, this struct should be referenced as CTxMemPool::Options.
4344
*/
4445
struct MemPoolOptions {
46+
/* Used to estimate appropriate transaction fees. */
47+
CBlockPolicyEstimator* estimator{nullptr};
4548
/* The ratio used to determine how often sanity checks will run. */
4649
int check_ratio{0};
4750
int64_t max_size_bytes{DEFAULT_MAX_MEMPOOL_SIZE_MB * 1'000'000};

src/txmempool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ struct entry_time {};
209209
struct ancestor_score {};
210210
struct index_by_wtxid {};
211211

212+
class CBlockPolicyEstimator;
213+
212214
/**
213215
* Information about a mempool transaction.
214216
*/

0 commit comments

Comments
 (0)