Add username and ip logging for RPC method requests

This commit is contained in:
Gabriel Davidian
2018-03-25 18:25:09 +00:00
parent 7466a26cab
commit 4d74c78c69
3 changed files with 8 additions and 2 deletions

View File

@@ -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