diff options
| author | Nils Schneider <[email protected]> | 2011-09-19 12:19:15 -0700 |
|---|---|---|
| committer | Nils Schneider <[email protected]> | 2011-09-19 12:19:15 -0700 |
| commit | 2d294e080c192cbea5ac0e331a3aab695cee37c8 (patch) | |
| tree | f8ddcddad11b3f880b2d3bd855a867ea19bca212 /src/main.cpp | |
| parent | Merge pull request #519 from dabaopku/master (diff) | |
| parent | missed printf in AbortMessage(); merged printfs in EndMessage (diff) | |
| download | discoin-2d294e080c192cbea5ac0e331a3aab695cee37c8.tar.xz discoin-2d294e080c192cbea5ac0e331a3aab695cee37c8.zip | |
Merge pull request #520 from tcatm/less-logging
log low-level network messages only when fDebug is set
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5b159fe41..6a3bacc78 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); |