Suggested by @MarcoFalke after #14627 and possibly #14420. We should warn if an unrecognised/incorrect section is present in bitcoin.conf. i.e `[testnet]` is present instead of `[test]`.
{
    LogPrintf("%s: In progress...\n", __func__);
    static CCriticalSection cs_Shutdown;
    TRY_LOCK(cs_Shutdown, lockShutdown);
    if (!lockShutdown)
        return;
    
    
    
    
    RenameThread("bitcoin-shutoff");
    mempool.AddTransactionsUpdated(1);
    StopHTTPRPC();
    StopREST();
    StopRPC();
    StopHTTPServer();
    for (const auto& client : interfaces.chain_clients) {
        client->flush();
    }
    StopMapPort();