Fixes #8117
There were several issues:
InitBlockIndex
was still callingActivateBestChain
(intended so the genesis block would be activated), which caused the full chain activate to occur immediately (before the node was fully started and RPC was enabled). Remove this, as this is dealt with during the background import thread now.- Use a signal and a condition variable to make AppInit2 wait for the genesis block to activate, rather than a sleep-and-test loop (which needs the heavily contended cs_main at that point).
- Introduce an extra init message after loading the banlist (which is confusing).
- Do a block space check earlier.
If accepted, I propose that the first commit is backported to 0.13. The second needs extra translation, unfortunately.