Steps to reproduce:

* Create a datadir that is pruned
* Start with `-prune=550 -reindex-chainstate`
* Hangs with idle CPU

(`-reindex` works)
StartScriptCheckWorkerThreads(script_threads);
    }
    assert(!node.scheduler);
    node.scheduler = std::make_unique<CScheduler>();
    
    node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { node.scheduler->serviceQueue(); });
    
    node.scheduler->scheduleEvery([]{
        RandAddPeriodic();
    }, std::chrono::minutes{1});
    GetMainSignals().RegisterBackgroundSignalScheduler(*node.scheduler);
    
    
    
    
    g_wallet_init_interface.Construct(node);
    uiInterface.InitWallet();
    * Register RPC commands regardless of -server setting so they will be
     * available in the GUI RPC console even if external calls are disabled.
     *
    RegisterAllCoreRPCCommands(tableRPC);
    for (const auto& client : node.chain_clients) {
        client->registerRpcs();
    }
#if ENABLE_ZMQ
    RegisterZMQRPCCommands(tableRPC);
#endif
    * Start the RPC server already.  It will be started in "warmup" mode
     * and not really process calls already (but it will signify connections
     * that the server is there and will be ready later).  Warmup mode will