Skip to content

Commit 1a5dbc5

Browse files
sipaFuzzbawls
authored andcommitted
Don't log RandAddSeedPerfmon details
These are hard to deal with, as in a follow-up this function can get called before the logging infrastructure is initialized.
1 parent 32e6c42 commit 1a5dbc5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/random.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ static void RandAddSeedPerfmon()
166166
if (ret == ERROR_SUCCESS) {
167167
RAND_add(vData.data(), nSize, nSize / 100.0);
168168
memory_cleanse(vData.data(), nSize);
169-
LogPrint(BCLog::RAND, "%s: %lu bytes\n", __func__, nSize);
170169
} else {
171-
static bool warned = false; // Warn only once
172-
if (!warned) {
173-
LogPrintf("%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\n", __func__, ret);
174-
warned = true;
175-
}
170+
// Performance data is only a best-effort attempt at improving the
171+
// situation when the OS randomness (and other sources) aren't
172+
// adequate. As a result, failure to read it is isn't considered critical,
173+
// so we don't call RandFailure().
174+
// TODO: Add logging when the logger is made functional before global
175+
// constructors have been invoked.
176176
}
177177
#endif
178178
}

0 commit comments

Comments
 (0)