Bitcoin

Bitcoin Core – Rewinding block… and Loading block index are frequently displayed.

I am using Core Wallet.

There are a variety of wallet applications with “core” in their names. This answer applies to Bitcoin Core, but not Bitcore or any other wallet with the word “core” in its name.


I often see the rewind block…

I can’t find the word “Rewinding” in the source code for Bitcoin Core v23.

The emergence of the word “rewind” seems to be related to blockchain reconstruction. Murch noted that one-blockchain tip changes may occur once every two weeks. This is a normal phenomenon and there is no need to worry.

The only similar message I can find about “rewind” is this:

index\base.cpp:                    FatalError("%s: Failed to rewind index %s to a previous chain tip",
index\base.cpp:            FatalError("%s: Failed to rewind index %s to a previous chain tip",

I don’t have any real insight as I’m not working on this code, but reviewing the source code might help clarify what this means. for example

        // Ensure block connects to an ancestor of the current best block. This should be the case
        // most of the time, but may not be immediately after the sync thread catches up and sets
        // m_synced. Consider the case where there is a reorg and the blocks on the stale branch are
        // in the ValidationInterface queue backlog even after the sync thread has caught up to the
        // new chain tip. In this unlikely event, log a warning and let the queue clear.
        if (best_block_index->GetAncestor(pindex->nHeight - 1) != pindex->pprev) 
            LogPrintf("%s: WARNING: Block %s does not connect to an ancestor of " /* Continued */
                      "known best chain (tip=%s); not updating index\n",
                      __func__, pindex->GetBlockHash().ToString(),
                      best_block_index->GetBlockHash().ToString());
            return;
        
        if (best_block_index != pindex->pprev && !Rewind(best_block_index, pindex->pprev)) 
            FatalError("%s: Failed to rewind index %s to a previous chain tip",
                       __func__, GetName());
            return;
        

If index rewind fails fatal If an error occurs, Bitcoin Core is expected to terminate. Perhaps it indicates data corruption?


…and loading block index

Every time you start Bitcoin Core, it must first load part of the database and verify its integrity. This is done step by step, and informational messages tell you how far the process has progressed. Loading the block index is part of it:

block loading

On my PC, “Loading block index…” is quickly replaced by “Verifying block…”

Enter image description here

A “Loading block index” message appears. init.cpp and qt/bitcoinstrings.cpp From Bitcoin Core’s source code.

Related Articles

Back to top button