After calling any of the `waitfor*` commands in the GUI RPC console, trying to shutdown / `bitcoin-cli stop` will hang `bitcoin-qt`.
{
        stats.clear();
        if (m_context.connman) {
            std::vector<CNodeStats> stats_temp;
            m_context.connman->GetNodeStats(stats_temp);
            stats.reserve(stats_temp.size());
            for (auto& node_stats_temp : stats_temp) {
                stats.emplace_back(std::move(node_stats_temp), false, CNodeStateStats());
            }
            
            TRY_LOCK(::cs_main, lockMain);
            if (lockMain) {
                for (auto& node_stats : stats) {
                    std::get<1>(node_stats) =
                        GetNodeStateStats(std::get<0>(node_stats).nodeid, std::get<2>(node_stats));
                }
            }
            return true;
        }
        return false;
    }
    bool getBanned(banmap_t& banmap) override
    {
        if (m_context.banman) {
            m_context.banman->GetBanned(banmap);
            return true;
        }
        return false;
    }
    bool ban(const CNetAddr& net_addr, BanReason reason, int64_t ban_time_offset) override