1

The following CLI command:

$ bitcoin-cli getblockcount

Gives the following error message:

error code: -28
error message:
Activating best chain...

Any idea what is error code: -28?

9

Error -28 is defined as RPC_IN_WARMUP, see https://github.com/bitcoin/bitcoin/blob/master/src/rpc/protocol.h.

The bitcoind server has just started and is still processing its stored blockchain data to figure out what it has. It can take several minutes. Activating best chain is one stage of this, where the daemon looks at the blocks it knows so far and determines which fork is the best chain. So it cannot yet tell you the number of blocks (in the best chain), because it doesn't yet know what the best chain is.

If you try the call again in a few minutes, it should succeed.

  • 1
    Seems like a patch making the bitcoin-cli error message print that text would be helpful. =) – Conspicuous Compiler Jul 22 '16 at 16:57
4

This would be normal if you just started your bitcoind service and it is still verifying downloaded blocks.

It can be a result that bitcoind did not had time enough to write changes to disk last time it was used or that it downloaded blocks but didn't prozess them jet.

Just let bitcoind run a bit longer and try the command again.

Here is a similar answer that goes a bit into more detail: What does "Activating Best Chain" mean?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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