Changeset View
Changeset View
Standalone View
Standalone View
src/timedata.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) { | ||||
} else { | } else { | ||||
nTimeOffset = 0; | nTimeOffset = 0; | ||||
static bool fDone; | static bool fDone; | ||||
if (!fDone) { | if (!fDone) { | ||||
// If nobody has a time different than ours but within 5 minutes | // If nobody has a time different than ours but within 5 minutes | ||||
// of ours, give a warning | // of ours, give a warning | ||||
bool fMatch = false; | bool fMatch = false; | ||||
for (int64_t nOffset : vSorted) { | for (const int64_t nOffset : vSorted) { | ||||
if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; | if (nOffset != 0 && abs64(nOffset) < 5 * 60) fMatch = true; | ||||
} | } | ||||
if (!fMatch) { | if (!fMatch) { | ||||
fDone = true; | fDone = true; | ||||
std::string strMessage = | std::string strMessage = | ||||
strprintf(_("Please check that your computer's date " | strprintf(_("Please check that your computer's date " | ||||
"and time are correct! If your clock is " | "and time are correct! If your clock is " | ||||
"wrong, %s will not work properly."), | "wrong, %s will not work properly."), | ||||
_(PACKAGE_NAME)); | _(PACKAGE_NAME)); | ||||
SetMiscWarning(strMessage); | SetMiscWarning(strMessage); | ||||
uiInterface.ThreadSafeMessageBox( | uiInterface.ThreadSafeMessageBox( | ||||
strMessage, "", CClientUIInterface::MSG_WARNING); | strMessage, "", CClientUIInterface::MSG_WARNING); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (LogAcceptCategory(BCLog::NET)) { | if (LogAcceptCategory(BCLog::NET)) { | ||||
for (int64_t n : vSorted) { | for (const int64_t n : vSorted) { | ||||
LogPrintToBeContinued(BCLog::NET, "%+d ", n); | LogPrintToBeContinued(BCLog::NET, "%+d ", n); | ||||
} | } | ||||
LogPrintToBeContinued(BCLog::NET, "| "); | LogPrintToBeContinued(BCLog::NET, "| "); | ||||
LogPrint(BCLog::NET, "nTimeOffset = %+d (%+d minutes)\n", | LogPrint(BCLog::NET, "nTimeOffset = %+d (%+d minutes)\n", | ||||
nTimeOffset, nTimeOffset / 60); | nTimeOffset, nTimeOffset / 60); | ||||
} | } | ||||
} | } | ||||
} | } |