Rescanning the blockchain can take some time. How can I tell (via RPC) when the rescanblockchain command has finished? Will it block until it's done, and only then return? Or is there another RPC I can use to see its progress?

Does the same answer apply to other RPC calls that might trigger a rescan, such as importmulti and loadwallet?

I'm worried about (if it blocks) the user experience of sitting there for possibly minutes with no progress indication; or (if it doesn't block) future RPC calls (such as getbalance) getting stale info before the rescan has completed.

3 Answers 3


rescanblockchain will block until it is complete. This will happen for any RPC which rescans the blockchain.

However, this does not mean that the RPC interface is unusable. You can still interact with it from another thread. If a rescan is taking too long, you can use abortrescan from another thread/process (e.g. another terminal session) to cancel the ongoing rescan.

You can use getwalletinfo for seeing the progress of a rescan. If you are using bitcoin-qt, a dialog window will appear with a progress bar showing the rescan progress.

  • What happens if the blockchain has been purged? Will it re-download the necessary blocks, and if so, will the RPC block until that's all done? (Could take days...) What happens if bitcoind is shutdown or killed in the middle of a rescan? Is there any indication that it did not complete successfully? Dec 30, 2018 at 3:18
  • 1
    bitcoind will give you an error if you are trying to rescan blocks that have been pruned. It will not scan at all. If bitcoind is shutdown or crashes, the rescan will be aborted and not continued when started later. There is rescan information that is logged to the debug.log file, including when it started, it's progress, whether it was aborted or completed, and why it was aborted.
    – Ava Chow
    Dec 30, 2018 at 17:26
  • As you correctly interpreted, I meant pruned, not purged. Dec 30, 2018 at 17:54
  • 1
    Starting in v0.19, getwalletinfo will report the scan progress via RPC. Yay! May 6, 2019 at 15:48

Look at the debug.log file.

For example, by running this in a terminal:

tail -f ~/.bitcoin/debug.log
  • The question is about how to tell via RPC, not interactively in a terminal window. Apr 3, 2019 at 4:42
  • With no way to get info by RPC, this is the best answer
    – Ron
    Feb 5, 2022 at 18:42

Updated answer in from Bitcoin Core v0.19:

The getwalletinfo RPC response contains a field scanning which has rescan status.

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.