3

Let's say I have a fully synced node that returns "initialblockdownload": false. If I turn it off, will it show "initialblockdownload": true when I start the node again? In other words, if initialblockdownload is false, will it be set to true again if the node needs to resync?

1 Answer 1

5

The initialblockdownload field in the output of the getblockchaininfo RPC reports the internal "IsInitialBlockDownload" state of the node software.

The value of this state is always true at startup, and latches to false whenever both of these conditions are true:

  • The currently active chain has at least as much cumulative PoW as the hardcoded constant in the software (updated every major release).
  • The timestamp of the currently active tip is no more than 24 hours in the past.

Whenever the IsInitialBlockDownload state latches to false, it never reverts to true (unless restarted).

3
  • 1
    What would happen if your node was running but had no connection to another node? Wouldn’t it revert to initialblockdownload: false after 24h?
    – Murch
    Commented Mar 8 at 15:44
  • 1
    @Murch No, it never reverts to false unless restarted (as of Bitcoin Core 26.x). I don't think there would be anything wrong with reverting in such a scenario, but I also don't think it adds much. Commented Mar 8 at 16:08
  • This one-way behavior also has the advantage that once initialblockdownload becomes false (actually, ChainstateManager::m_cached_finished_ibd becomes true), this state can be reported to other software without locking cs_main. This improves system performance, since this state is queried often. Commented Mar 26 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.