Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/safemode.cpp
#include "safemode.h" | #include <rpc/safemode.h> | ||||
#include "rpc/protocol.h" | #include <rpc/protocol.h> | ||||
#include "util.h" | #include <util.h> | ||||
#include "warnings.h" | #include <warnings.h> | ||||
void ObserveSafeMode() { | void ObserveSafeMode() { | ||||
std::string warning = GetWarnings("rpc"); | std::string warning = GetWarnings("rpc"); | ||||
if (warning != "" && | if (warning != "" && | ||||
!gArgs.GetBoolArg("-disablesafemode", DEFAULT_DISABLE_SAFEMODE)) { | !gArgs.GetBoolArg("-disablesafemode", DEFAULT_DISABLE_SAFEMODE)) { | ||||
throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, | throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, | ||||
std::string("Safe mode: ") + warning); | std::string("Safe mode: ") + warning); | ||||
} | } | ||||
} | } |