mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
tx fees, policy: periodically flush fee estimates to fee_estimates.dat
This reduces chances of having old estimates in fee_estimates.dat.
This commit is contained in:
parent
681ecac5c2
commit
5b886f2b43
3 changed files with 22 additions and 1 deletions
|
|
@ -1253,7 +1253,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
assert(!node.fee_estimator);
|
||||
// Don't initialize fee estimation with old data if we don't relay transactions,
|
||||
// as they would never get updated.
|
||||
if (!ignores_incoming_txs) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>(FeeestPath(args));
|
||||
if (!ignores_incoming_txs) {
|
||||
node.fee_estimator = std::make_unique<CBlockPolicyEstimator>(FeeestPath(args));
|
||||
|
||||
// Flush estimates to disk periodically
|
||||
CBlockPolicyEstimator* fee_estimator = node.fee_estimator.get();
|
||||
node.scheduler->scheduleEvery([fee_estimator] { fee_estimator->FlushFeeEstimates(); }, FEE_FLUSH_INTERVAL);
|
||||
}
|
||||
|
||||
// Check port numbers
|
||||
for (const std::string port_option : {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue