diff --git a/src/rpc/jsonrpc.cc b/src/rpc/jsonrpc.cc index 395b5999..611c35aa 100644 --- a/src/rpc/jsonrpc.cc +++ b/src/rpc/jsonrpc.cc @@ -146,7 +146,7 @@ jsonrpc_call_command(const std::string& method, const json& params) { CommandMap::iterator itr = commands.find(method.c_str()); - if (itr == commands.end()) { + if (itr == commands.end() || !(itr->second.m_flags & CommandMap::flag_public_rpc)) { throw rpc_error(JSONRPC_METHOD_NOT_FOUND_ERROR, "method not found: " + method); }