aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorNils Schneider <nils.schneider@gmail.com>2011-09-17 18:29:41 +0200
committerNils Schneider <nils.schneider@gmail.com>2011-09-17 18:29:41 +0200
commit59090133c0ffae33a4f5a186567ba6a514d2c11b (patch)
tree2b1cb0f9f610d27c29a45f7b95171f10cb0f0835 /src/net.h
parent217208a36d210e7d51e405d0e531ac2b75a3a087 (diff)
log low-level network messages only when fDebug is set
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index efac1f452a..a8356eade1 100644
--- a/src/net.h
+++ b/src/net.h
@@ -282,9 +282,10 @@ public:
nHeaderStart = vSend.size();
vSend << CMessageHeader(pszCommand, 0);
nMessageStart = vSend.size();
- if (fDebug)
+ if (fDebug) {
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
- printf("sending: %s ", pszCommand);
+ printf("sending: %s ", pszCommand);
+ }
}
void AbortMessage()
@@ -324,8 +325,10 @@ public:
memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum));
}
- printf("(%d bytes) ", nSize);
- printf("\n");
+ if (fDebug) {
+ printf("(%d bytes) ", nSize);
+ printf("\n");
+ }
nHeaderStart = -1;
nMessageStart = -1;