mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Refactor: Removed begin/end_ptr functions.
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
#include "compat.h" // for Windows API
|
||||
#include <wincrypt.h>
|
||||
#endif
|
||||
#include "serialize.h" // for begin_ptr(vec)
|
||||
#include "util.h" // for LogPrint()
|
||||
#include "utilstrencodings.h" // for GetTime()
|
||||
|
||||
@@ -72,15 +71,15 @@ static void RandAddSeedPerfmon()
|
||||
const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data
|
||||
while (true) {
|
||||
nSize = vData.size();
|
||||
ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, begin_ptr(vData), &nSize);
|
||||
ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, vData.data(), &nSize);
|
||||
if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize)
|
||||
break;
|
||||
vData.resize(std::max((vData.size() * 3) / 2, nMaxSize)); // Grow size of buffer exponentially
|
||||
}
|
||||
RegCloseKey(HKEY_PERFORMANCE_DATA);
|
||||
if (ret == ERROR_SUCCESS) {
|
||||
RAND_add(begin_ptr(vData), nSize, nSize / 100.0);
|
||||
memory_cleanse(begin_ptr(vData), nSize);
|
||||
RAND_add(vData.data(), nSize, nSize / 100.0);
|
||||
memory_cleanse(vData.data(), nSize);
|
||||
LogPrint("rand", "%s: %lu bytes\n", __func__, nSize);
|
||||
} else {
|
||||
static bool warned = false; // Warn only once
|
||||
|
||||
Reference in New Issue
Block a user