aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
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/main.cpp
parent217208a36d210e7d51e405d0e531ac2b75a3a087 (diff)
log low-level network messages only when fDebug is set
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5b159fe415..6a3bacc78e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1744,9 +1744,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
static map<unsigned int, vector<unsigned char> > mapReuseKey;
RandAddSeedPerfmon();
- if (fDebug)
+ if (fDebug) {
printf("%s ", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
- printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
+ printf("received: %s (%d bytes)\n", strCommand.c_str(), vRecv.size());
+ }
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
{
printf("dropmessagestest DROPPING RECV MESSAGE\n");
@@ -1934,7 +1935,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
pfrom->AddInventoryKnown(inv);
bool fAlreadyHave = AlreadyHave(txdb, inv);
- printf(" got inventory: %s %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new");
+ if (fDebug)
+ printf(" got inventory: %s %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new");
if (!fAlreadyHave)
pfrom->AskFor(inv);