| 361 | } |
| 362 | |
| 363 | void OnRPCPreCommand(const CRPCCommand& cmd) |
| 364 | { |
| 365 | #ifdef ENABLE_WALLET |
| 366 | if (cmd.reqWallet && !pwalletMain) |
| 367 | throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)"); |
| 368 | #endif |
| 369 | |
| 370 | // Observe safe mode |
| 371 | string strWarning = GetWarnings("rpc"); |
| 372 | if (strWarning != "" && !GetBoolArg("-disablesafemode", false) && |
| 373 | !cmd.okSafeMode) |
| 374 | throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, string("Safe mode: ") + strWarning); |
| 375 | } |
| 376 | |
| 377 | std::string HelpMessage(HelpMessageMode mode) |
| 378 | { |
nothing calls this directly
no test coverage detected