diff options
author | glozow <gloriajzhao@gmail.com> | 2023-08-22 08:42:44 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2023-08-22 09:17:12 +0100 |
commit | a84dade1f9df747bb440bedb474ea629d2d6ff34 (patch) | |
tree | 10f3654795338c113861fef8633f8718aed019c9 /src/policy | |
parent | ded687334031f4790ef6a36b999fb30a79dcf7b3 (diff) | |
parent | ee5a0369cc4305da7b3d26f37677de05ad797e51 (diff) |
Merge bitcoin/bitcoin#28157: test doc: tests `acceptstalefeeestimates` option is only supported on regtest chain
ee5a0369cc4305da7b3d26f37677de05ad797e51 test: ensure acceptstalefeeestimates is supported only on regtest chain (ismaelsadeeq)
22d5d4b2b2486feaef981e96f0321f020617f082 tx fees, policy: doc: update and delete unnecessary comment (ismaelsadeeq)
Pull request description:
This PR Follow up comments from [#27622](https://github.com/bitcoin/bitcoin/pull/27622)
It test that the new `regtest-only` option `acceptstalefeeestimates` is not supported on [main, signet and test chains](https://github.com/bitcoin/bitcoin/pull/27622/files#r1235218268), removes an unnecessary [comment](https://github.com/bitcoin/bitcoin/pull/27622/files#r1235204323), and update fee estimator `MAXFILEAGE` [description comment](https://github.com/bitcoin/bitcoin/pull/27622/files#r1233887314).
ACKs for top commit:
jonatack:
ACK ee5a0369cc4305da7b3d26f37677de05ad797e51
glozow:
utACK ee5a0369cc4305da7b3d26f37677de05ad797e51
Tree-SHA512: 4755f25b08db62f37614ea768272b12580ee0d481fb7fa339379901a6132c66828777c6747d3fe67490ceace3a6ff248bf13bdf65720f6e5ba8642eb762acd3c
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/fees.cpp | 2 | ||||
-rw-r--r-- | src/policy/fees.h | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index c8f2df781b..553c88fddc 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -548,14 +548,12 @@ CBlockPolicyEstimator::CBlockPolicyEstimator(const fs::path& estimation_filepath AutoFile est_file{fsbridge::fopen(m_estimation_filepath, "rb")}; - // Whenever the fee estimation file is not present return early if (est_file.IsNull()) { LogPrintf("%s is not found. Continue anyway.\n", fs::PathToString(m_estimation_filepath)); return; } std::chrono::hours file_age = GetFeeEstimatorFileAge(); - // fee estimate file must not be too old to avoid wrong fee estimates. if (file_age > MAX_FILE_AGE && !read_stale_estimates) { LogPrintf("Fee estimation file %s too old (age=%lld > %lld hours) and will not be used to avoid serving stale estimates.\n", fs::PathToString(m_estimation_filepath), Ticks<std::chrono::hours>(file_age), Ticks<std::chrono::hours>(MAX_FILE_AGE)); return; diff --git a/src/policy/fees.h b/src/policy/fees.h index 52761f03ca..8ed13482e9 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -25,8 +25,9 @@ // How often to flush fee estimates to fee_estimates.dat. static constexpr std::chrono::hours FEE_FLUSH_INTERVAL{1}; -/** fee_estimates.dat that are more than 60 hours (2.5 days) will not be read, - * as the estimates in the file are stale. +/** fee_estimates.dat that are more than 60 hours (2.5 days) old will not be read, + * as fee estimates are based on historical data and may be inaccurate if + * network activity has changed. */ static constexpr std::chrono::hours MAX_FILE_AGE{60}; |