aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-07-31 11:43:50 -0400
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-04 16:59:28 +0200
commit70b9d36a2c7b900a80323e33ddc06b14d28fe538 (patch)
treed0e38b70f38e30e54682d37bceee6d025fb5afb8
parentab676c3ac4c2d9f8a27cd0bbbd4f5ba487b0b24a (diff)
Log "version" message IP addresses in client connect summary
The only other method of logging remote addresses is via -logips=1 -debug=net which increases the logged activity by 100x or more. Github-Pull: #4608 Amended-By: Wladimir J. van der Laan <laanwj@gmail.com>
-rw-r--r--src/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index cf9318fedf..ba521b6b19 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3628,7 +3628,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
pfrom->fSuccessfullyConnected = true;
- LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, peer=%d\n", pfrom->cleanSubVer, pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString(), pfrom->id);
+ string remoteAddr;
+ if (fLogIPs)
+ remoteAddr = ", peeraddr=" + pfrom->addr.ToString();
+
+ LogPrintf("receive version message: %s: version %d, blocks=%d, us=%s, peer=%d%s\n",
+ pfrom->cleanSubVer, pfrom->nVersion,
+ pfrom->nStartingHeight, addrMe.ToString(), pfrom->id,
+ remoteAddr);
AddTimeData(pfrom->addr, nTime);
}