diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-03-27 20:43:34 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-03-27 20:53:06 +0200 |
| commit | b648974cc35a65df87c2801f5c09dd13d3e507f7 (patch) | |
| tree | d990e38ca08d433941c70f45d9a1bb72ca18fa06 /src/httprpc.cpp | |
| parent | Merge #12762: Make CKeyStore an interface (diff) | |
| parent | Add username and ip logging for RPC method requests (diff) | |
| download | discoin-b648974cc35a65df87c2801f5c09dd13d3e507f7.tar.xz discoin-b648974cc35a65df87c2801f5c09dd13d3e507f7.zip | |
Merge #12778: RPC: Add username and ip logging for RPC method requests
4d74c78 Add username and ip logging for RPC method requests (Gabriel Davidian)
Pull request description:
Adds username and IP logging (if enabled via -logips command) to RPC method request logging.
This closes #12223
Tree-SHA512: a441228e80ea6884ec379c66e949d86df3689770f1b3c3608015cf5a36d2dfb38051298a7f6ea6dfdfbf0b3b6c896e414c8dc54e9833bb73dd65bdb1832f4395
Diffstat (limited to 'src/httprpc.cpp')
| -rw-r--r-- | src/httprpc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/httprpc.cpp b/src/httprpc.cpp index ed0a03070..0a70619ba 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 |