After calling any of the `waitfor*` commands in the GUI RPC console, trying to shutdown / `bitcoin-cli stop` will hang `bitcoin-qt`.
{
    unsigned int vcidx;
    for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); vcidx++)
    {
        const CRPCCommand *pcmd;
        pcmd = &vRPCCommands[vcidx];
        mapCommands[pcmd->name].push_back(pcmd);
    }
}
bool CRPCTable::appendCommand(const std::string& name, const CRPCCommand* pcmd)
{
    if (IsRPCRunning())
        return false;
    mapCommands[name].push_back(pcmd);
    return true;
}
bool CRPCTable::removeCommand(const std::string& name, const CRPCCommand* pcmd)
{
    auto it = mapCommands.find(name);
    if (it != mapCommands.end()) {
        auto new_end = std::remove(it->second.begin(), it->second.end(), pcmd);
        if (it->second.end() != new_end) {
            it->second.erase(new_end, it->second.end());
            return true;
        }
    }
    return false;
}
void StartRPC()