mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
scripted-diff: Use UniValue::find_value method
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i 's/find_value\(([^ ,]+), /\1.find_value(/g' $(git grep -l find_value) -END VERIFY SCRIPT-
This commit is contained in:
@@ -76,7 +76,7 @@ static void JSONErrorReply(HTTPRequest* req, const UniValue& objError, const Uni
|
||||
{
|
||||
// Send error reply from json-rpc error object
|
||||
int nStatus = HTTP_INTERNAL_SERVER_ERROR;
|
||||
int code = find_value(objError, "code").getInt<int>();
|
||||
int code = objError.find_value("code").getInt<int>();
|
||||
|
||||
if (code == RPC_INVALID_REQUEST)
|
||||
nStatus = HTTP_BAD_REQUEST;
|
||||
@@ -213,7 +213,7 @@ static bool HTTPReq_JSONRPC(const std::any& context, HTTPRequest* req)
|
||||
} else {
|
||||
const UniValue& request = valRequest[reqIdx].get_obj();
|
||||
// Parse method
|
||||
std::string strMethod = find_value(request, "method").get_str();
|
||||
std::string strMethod = request.find_value("method").get_str();
|
||||
if (!g_rpc_whitelist[jreq.authUser].count(strMethod)) {
|
||||
LogPrintf("RPC User %s not allowed to call method %s\n", jreq.authUser, strMethod);
|
||||
req->WriteReply(HTTP_FORBIDDEN);
|
||||
|
||||
Reference in New Issue
Block a user