<!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->
<!-- Describe the issue -->
If you start a fresh copy of bitcoin-qt without any blockchain data, wait until the entire blockchain is downloaded, and then open a console window and try estimatesmartfee, the answer is
{
"errors": [
"Insufficient data or no feerate found"
],
"blocks": 1
}
<!--- What behavior did you expect? -->
I expected n estimate of the fee appropriate to the passed in number of blocks using the fees from the recently downloaded (and therefore newest) blocks.
I will not try to reproduce this issue because it takes several hours to download the blockchain.
This is Windows 10 with Bitcoin Core 0.21.1.
I don't believe this is a failure of the system or an anomaly in the environment, but rather an oversite in the processing of blocks when "catching up." I suspect that the process recognizes that the block received has been around a while and therefore doesn't bother updating the information required to answer estimatesmartfee. This makes sense because tracking that information for every received block would slow down the process too much.
Proposed solution: If one of the startup tasks were to identify the blockheight at which tracking fees would become useful, then the process could start tracking them once the blockheight was there. Otherwise, other layers that rely on estimatesmartfee (like ACINQ's Eclair Lightning node) have to wait an extra hour even though bitcoind has all the information it needs.
If there is information required by estaimatesmartfee that is not available to a node which has just finished downloading the blockchain, please add a comment explaining what it is.