Skip to content

Commit

Permalink
Don't log RandAddSeedPerfmon details
Browse files Browse the repository at this point in the history
These are hard to deal with, as in a follow-up this function can get
called before the logging infrastructure is initialized.
  • Loading branch information
sipa authored and Fuzzbawls committed Apr 14, 2021
1 parent 32e6c42 commit 1a5dbc5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ static void RandAddSeedPerfmon()
if (ret == ERROR_SUCCESS) {
RAND_add(vData.data(), nSize, nSize / 100.0);
memory_cleanse(vData.data(), nSize);
LogPrint(BCLog::RAND, "%s: %lu bytes\n", __func__, nSize);
} else {
static bool warned = false; // Warn only once
if (!warned) {
LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret);
warned = true;
}
// Performance data is only a best-effort attempt at improving the
// situation when the OS randomness (and other sources) aren't
// adequate. As a result, failure to read it is isn't considered critical,
// so we don't call RandFailure().
// TODO: Add logging when the logger is made functional before global
// constructors have been invoked.
}
#endif
}
Expand Down

0 comments on commit 1a5dbc5

Please sign in to comment.