Browse Source

Merge pull request #1458 from jgarzik/tracenet

Introduce -tracenet option, thereby quieting some redundant debug messages
miguelfreitas
Jeff Garzik 13 years ago
parent
commit
d62a1947be
  1. 7
      src/init.cpp
  2. 1
      src/main.cpp
  3. 1
      src/net.h
  4. 1
      src/util.cpp
  5. 1
      src/util.h

7
src/init.cpp

@ -358,6 +358,13 @@ bool AppInit2() @@ -358,6 +358,13 @@ bool AppInit2()
// ********************************************************* Step 3: parameter-to-internal-flags
fDebug = GetBoolArg("-debug");
// -debug implies fDebug*
if (fDebug)
fDebugNet = true;
else
fDebugNet = GetBoolArg("-debugnet");
bitdb.SetDetach(GetBoolArg("-detachdb", false));
#if !defined(WIN32) && !defined(QT_GUI)

1
src/main.cpp

@ -3151,6 +3151,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) @@ -3151,6 +3151,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
const CInv& inv = (*pto->mapAskFor.begin()).second;
if (!AlreadyHave(txdb, inv))
{
if (fDebugNet)
printf("sending getdata: %s\n", inv.ToString().c_str());
vGetData.push_back(inv);
if (vGetData.size() >= 1000)

1
src/net.h

@ -296,6 +296,7 @@ public: @@ -296,6 +296,7 @@ public:
// We're using mapAskFor as a priority queue,
// the key is the earliest time the request can be sent
int64& nRequestTime = mapAlreadyAskedFor[inv];
if (fDebugNet)
printf("askfor %s %"PRI64d"\n", inv.ToString().c_str(), nRequestTime);
// Make sure not to reuse time indexes to keep things in the same order

1
src/util.cpp

@ -58,6 +58,7 @@ using namespace std; @@ -58,6 +58,7 @@ using namespace std;
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
bool fDebug = false;
bool fDebugNet = false;
bool fPrintToConsole = false;
bool fPrintToDebugger = false;
bool fRequestShutdown = false;

1
src/util.h

@ -105,6 +105,7 @@ inline void Sleep(int64 n) @@ -105,6 +105,7 @@ inline void Sleep(int64 n)
extern std::map<std::string, std::string> mapArgs;
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
extern bool fDebug;
extern bool fDebugNet;
extern bool fPrintToConsole;
extern bool fPrintToDebugger;
extern bool fRequestShutdown;

Loading…
Cancel
Save