mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Replace printf with LogPrintf / LogPrint
This commit is contained in:
15
src/net.h
15
src/net.h
@@ -372,8 +372,7 @@ public:
|
||||
nRequestTime = it->second;
|
||||
else
|
||||
nRequestTime = 0;
|
||||
if (fDebugNet)
|
||||
printf("askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
|
||||
LogPrint("net", "askfor %s %"PRI64d" (%s)\n", inv.ToString().c_str(), nRequestTime, DateTimeStrFormat("%H:%M:%S", nRequestTime/1000000).c_str());
|
||||
|
||||
// Make sure not to reuse time indexes to keep things in the same order
|
||||
int64 nNow = (GetTime() - 1) * 1000000;
|
||||
@@ -399,8 +398,7 @@ public:
|
||||
ENTER_CRITICAL_SECTION(cs_vSend);
|
||||
assert(ssSend.size() == 0);
|
||||
ssSend << CMessageHeader(pszCommand, 0);
|
||||
if (fDebug)
|
||||
printf("sending: %s ", pszCommand);
|
||||
LogPrint("net", "sending: %s ", pszCommand);
|
||||
}
|
||||
|
||||
// TODO: Document the precondition of this function. Is cs_vSend locked?
|
||||
@@ -410,8 +408,7 @@ public:
|
||||
|
||||
LEAVE_CRITICAL_SECTION(cs_vSend);
|
||||
|
||||
if (fDebug)
|
||||
printf("(aborted)\n");
|
||||
LogPrint("net", "(aborted)\n");
|
||||
}
|
||||
|
||||
// TODO: Document the precondition of this function. Is cs_vSend locked?
|
||||
@@ -419,7 +416,7 @@ public:
|
||||
{
|
||||
if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
|
||||
{
|
||||
printf("dropmessages DROPPING SEND MESSAGE\n");
|
||||
LogPrint("net", "dropmessages DROPPING SEND MESSAGE\n");
|
||||
AbortMessage();
|
||||
return;
|
||||
}
|
||||
@@ -438,9 +435,7 @@ public:
|
||||
assert(ssSend.size () >= CMessageHeader::CHECKSUM_OFFSET + sizeof(nChecksum));
|
||||
memcpy((char*)&ssSend[CMessageHeader::CHECKSUM_OFFSET], &nChecksum, sizeof(nChecksum));
|
||||
|
||||
if (fDebug) {
|
||||
printf("(%d bytes)\n", nSize);
|
||||
}
|
||||
LogPrint("net", "(%d bytes)\n", nSize);
|
||||
|
||||
std::deque<CSerializeData>::iterator it = vSendMsg.insert(vSendMsg.end(), CSerializeData());
|
||||
ssSend.GetAndClear(*it);
|
||||
|
||||
Reference in New Issue
Block a user