mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
rpc: Push down safe mode checks
This contains most of the changes of 10563 "remove safe mode", but doesn't remove the safe mode yet, but put an `ObserveSafeMode()` check in individual calls with okSafeMode=false. This cleans up the ugly "okSafeMode" flag from the dispatch tables, which is not a concern for the RPC server. Extra-author: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
cee4fe1d53
commit
ec6902d0ea
@@ -51,11 +51,6 @@ void RPCServer::OnStopped(std::function<void ()> slot)
|
||||
g_rpcSignals.Stopped.connect(slot);
|
||||
}
|
||||
|
||||
void RPCServer::OnPreCommand(std::function<void (const CRPCCommand&)> slot)
|
||||
{
|
||||
g_rpcSignals.PreCommand.connect(boost::bind(slot, _1));
|
||||
}
|
||||
|
||||
void RPCTypeCheck(const UniValue& params,
|
||||
const std::list<UniValue::VType>& typesExpected,
|
||||
bool fAllowNull)
|
||||
@@ -267,12 +262,12 @@ UniValue uptime(const JSONRPCRequest& jsonRequest)
|
||||
* Call Table
|
||||
*/
|
||||
static const CRPCCommand vRPCCommands[] =
|
||||
{ // category name actor (function) okSafe argNames
|
||||
// --------------------- ------------------------ ----------------------- ------ ----------
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
/* Overall control/query calls */
|
||||
{ "control", "help", &help, true, {"command"} },
|
||||
{ "control", "stop", &stop, true, {} },
|
||||
{ "control", "uptime", &uptime, true, {} },
|
||||
{ "control", "help", &help, {"command"} },
|
||||
{ "control", "stop", &stop, {} },
|
||||
{ "control", "uptime", &uptime, {} },
|
||||
};
|
||||
|
||||
CRPCTable::CRPCTable()
|
||||
|
||||
Reference in New Issue
Block a user