1

I turn my PC on every day. I don't sleep more than 8 hours. Yet Bitcoin Core, after I verify that it has fully synced every day, keeps saying "7 days remaining" for example, as if it deletes the last week's data every time I shut down the computer and starts over from that point every time I turn it back on again.

What gives? This has started happening only recently. 0.20.1.

1
  • Do you shutdown cleanly? The chainstate is only flushed to disk once per day, or at shutdown. Sep 24, 2020 at 17:56

1 Answer 1

2

As Pieter pointed out, it sounds like your Bitcoin Core is not shutting down cleanly when you turn off your computer. This could happen for example if the shutdown process does not wait for Bitcoin Core to shut down cleanly before killing it, or if the computer is just powered off immediately.

Bitcoin Core caches progress to the chainstate¹. The chainstate is only written to disk on (clean) shutdown or after running for 24 hours. If Bitcoin Core is shut down forcefully before that, it falls back to the chainstate it had at startup, losing all synchronization progress since starting.

Since block data gets written to disk as received, it will not have to retrieve the blocks again. Bitcoin Core will recreate the chainstate from the blocks on disk on next startup, and continue synchronization from that point.

Whether this is a case of unclean shutdowns could be verified by inspecting the debug.log in your Bitcoin directory. If it is, you could manually close Bitcoin Core before shutting down your computer, or configure your computer to give programs more time to shut down to ensure that your synchronization progress is saved.


¹ A lot of the data that Bitcoin Core creates during synchronization is only written and read once before being discarding. While Bitcoin Core is running, caching this data and never writing the discarded data to disk translates to quicker validation.

Your Answer

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

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