Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

safemode.cpp
Go to the documentation of this file.
1 #include <rpc/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 
static const bool DEFAULT_DISABLE_SAFEMODE
Definition: safemode.h:8
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: util.cpp:824
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:108
Server is in safe mode, and command is not allowed in safe mode.
Definition: protocol.h:49
void ObserveSafeMode()
Definition: safemode.cpp:7
UniValue JSONRPCError(int code, const std::string &message)
Definition: protocol.cpp:54
Released under the MIT license