Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 2,945 Lines • ▼ Show 20 Lines | void CNode::AskFor(const CInv &inv) { | ||||
limitedmap<uint256, int64_t>::const_iterator it = | limitedmap<uint256, int64_t>::const_iterator it = | ||||
mapAlreadyAskedFor.find(inv.hash); | mapAlreadyAskedFor.find(inv.hash); | ||||
if (it != mapAlreadyAskedFor.end()) { | if (it != mapAlreadyAskedFor.end()) { | ||||
nRequestTime = it->second; | nRequestTime = it->second; | ||||
} else { | } else { | ||||
nRequestTime = 0; | nRequestTime = 0; | ||||
} | } | ||||
LogPrint(BCLog::NET, "askfor %s %d (%s) peer=%d\n", inv.ToString(), | LogPrint(BCLog::NET, "askfor %s %d (%s) peer=%d\n", inv.ToString(), | ||||
nRequestTime, | nRequestTime, FormatISO8601DateTime(nRequestTime / 1000000), id); | ||||
DateTimeStrFormat("%H:%M:%S", nRequestTime / 1000000), id); | |||||
// Make sure not to reuse time indexes to keep things in the same order | // Make sure not to reuse time indexes to keep things in the same order | ||||
int64_t nNow = GetTimeMicros() - 1000000; | int64_t nNow = GetTimeMicros() - 1000000; | ||||
static int64_t nLastTime; | static int64_t nLastTime; | ||||
++nLastTime; | ++nLastTime; | ||||
nNow = std::max(nNow, nLastTime); | nNow = std::max(nNow, nLastTime); | ||||
nLastTime = nNow; | nLastTime = nNow; | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |