diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-09-23 13:42:04 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-09-23 13:42:04 +0200 |
commit | 0961c2fc0d0f9d8a0dee46f8e2020ac479d5b997 (patch) | |
tree | 94e89c52d16c031ba12017bfa56d51e5bd9d1b33 /src | |
parent | b8afa21fad0e5d3e61deca9678d852efe8afc499 (diff) | |
parent | c7eb151ad0ed441d6fd598551059a9bbfb09e99e (diff) |
Merge branch 'master' of https://github.com/bitcoin/bitcoin
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 | ||||
-rw-r--r-- | src/net.cpp | 2 | ||||
-rw-r--r-- | src/net.h | 14 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index fc520df8ec..e732ddcf5d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1751,9 +1751,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"); @@ -1945,7 +1946,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); diff --git a/src/net.cpp b/src/net.cpp index 509d8905f9..2e257a6efc 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1713,7 +1713,7 @@ void StartNode(void* parg) printf("Error: CreateThread(ThreadIRCSeed) failed\n"); // Send and receive from sockets, accept connections - CreateThread(ThreadSocketHandler, NULL, true); + CreateThread(ThreadSocketHandler, NULL); // Initiate outbound connections if (!CreateThread(ThreadOpenConnections, NULL)) @@ -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() @@ -295,7 +296,9 @@ public: nHeaderStart = -1; nMessageStart = -1; cs_vSend.Leave(); - printf("(aborted)\n"); + + if (fDebug) + printf("(aborted)\n"); } void EndMessage() @@ -324,8 +327,9 @@ public: memcpy((char*)&vSend[nHeaderStart] + offsetof(CMessageHeader, nChecksum), &nChecksum, sizeof(nChecksum)); } - printf("(%d bytes) ", nSize); - printf("\n"); + if (fDebug) { + printf("(%d bytes)\n", nSize); + } nHeaderStart = -1; nMessageStart = -1; |