From 4d74c78c69123a3d97293f40337e2efa5dadbff0 Mon Sep 17 00:00:00 2001 From: Gabriel Davidian Date: Sun, 25 Mar 2018 18:25:09 +0000 Subject: Add username and ip logging for RPC method requests --- src/httprpc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/httprpc.cpp') diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 82ae733006..7eb9fa671c 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -158,8 +158,9 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &) } JSONRPCRequest jreq; + jreq.peerAddr = req->GetPeer().ToString(); if (!RPCAuthorized(authHeader.second, jreq.authUser)) { - LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", req->GetPeer().ToString()); + LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", jreq.peerAddr); /* Deter brute-forcing If this results in a DoS the user really -- cgit v1.2.3