diff options
author | R E Broadley <rebroad+github@gmail.com> | 2014-02-26 17:55:04 -0800 |
---|---|---|
committer | R E Broadley <rebroad+github@gmail.com> | 2014-07-04 09:38:44 +0700 |
commit | 2e36866fecb7420cd73047a7aa762a6e5e225695 (patch) | |
tree | 8722a5d841711574d6cd1b3106fa2e67935fbd85 /src/net.cpp | |
parent | f04f1234078288d4806aaab0952d60f137337e81 (diff) |
Show nodeid instead of addresses (for anonymity) unless otherwise requested.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 934c45ca4c..c7bdb83aad 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -491,8 +491,6 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) { addrman.Attempt(addrConnect); - LogPrint("net", "connected %s\n", pszDest ? pszDest : addrConnect.ToString()); - // Set to non-blocking #ifdef WIN32 u_long nOne = 1; @@ -513,6 +511,7 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) } pnode->nTimeConnected = GetTime(); + return pnode; } @@ -524,7 +523,7 @@ void CNode::CloseSocketDisconnect() fDisconnect = true; if (hSocket != INVALID_SOCKET) { - LogPrint("net", "disconnecting node %s\n", addrName); + LogPrint("net", "disconnecting peer=%d\n", id); closesocket(hSocket); hSocket = INVALID_SOCKET; } @@ -548,7 +547,10 @@ void CNode::PushVersion() CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService("0.0.0.0",0))); CAddress addrMe = GetLocalAddress(&addr); RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce)); - LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), addr.ToString()); + if (fLogIPs) + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); + else + LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<string>()), nBestHeight, true); } @@ -950,7 +952,6 @@ void ThreadSocketHandler() } else { - LogPrint("net", "accepted connection %s\n", addr.ToString()); CNode* pnode = new CNode(hSocket, addr, "", true); pnode->AddRef(); @@ -1040,7 +1041,7 @@ void ThreadSocketHandler() { if (pnode->nLastRecv == 0 || pnode->nLastSend == 0) { - LogPrint("net", "socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0); + LogPrint("net", "socket no message in first 60 seconds, %d %d from %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->id); pnode->fDisconnect = true; } else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL) |