Raven Core  3.0.0
P2P Digital Currency
safemode.cpp
Go to the documentation of this file.
1 #include "safemode.h"
2 
3 #include "rpc/protocol.h"
4 #include "util.h"
5 #include "warnings.h"
6 
8 {
9  std::string warning = GetWarnings("rpc");
10  if (warning != "" && !gArgs.GetBoolArg("-disablesafemode", DEFAULT_DISABLE_SAFEMODE)) {
11  throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, std::string("Safe mode: ") + warning);
12  }
13 }
14 
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: util.cpp:470
std::string GetWarnings(const std::string &strFor)
Format a string that describes several potential problems detected by the core.
Definition: warnings.cpp:41
ArgsManager gArgs
Definition: util.cpp:94
Server is in safe mode, and command is not allowed in safe mode.
Definition: protocol.h:50
void ObserveSafeMode()
Definition: safemode.cpp:7
UniValue JSONRPCError(int code, const std::string &message)
Definition: protocol.cpp:55