1

Why can't Core CLI query wallet balance until having loaded block index and verified blocks? It takes a few moments when running the test and sig nets, but when running the main net it is tough for my ages ancient hardware and takes many seconds. Sometimes it is a bit inconvenient. Shouldn't both loads be parallel?

1 Answer 1

6
+50

The wallet needs access to the chainstate for normal operation, and that needs access to the block index. So the wallet requires a chainstate in its constructor, and the object managing the chainstate is not available until after the block index has been loaded and the sanity checks completed. There are several places within the wallet which assume that the chainstate is available.

Additionally, there are many RPCs which need access to the chainstate and other node objects, and the general assumption with these RPCs is that those objects are available (they tend to be globals). So to avoid any issues with objects not being initialized yet, the RPC server will block all RPC calls until initialization is complete so that those objects are guaranteed to be initialized.

This probably could be changed to not block, however such a project would be likely be pretty big and require significant changes to the assumptions around global objects. As with all open source projects, the reason this has not been done is because no one has bothered to do it.

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.