mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Merge pull request #5824
32eaf8a
WIN32 Seed Cleanup: Move nLastPerfmon behind win32 ifdef. Code to avoid calling Perfmon too often is only needed when perfmon is actually going to get called. This is not intended to make any functional difference in the addition of entropy to the random pool. (21E14)
This commit is contained in:
commit
25d713c941
@ -47,15 +47,16 @@ void RandAddSeedPerfmon()
|
|||||||
{
|
{
|
||||||
RandAddSeed();
|
RandAddSeed();
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
// Don't need this on Linux, OpenSSL automatically uses /dev/urandom
|
||||||
|
// Seed with the entire set of perfmon data
|
||||||
|
|
||||||
// This can take up to 2 seconds, so only do it every 10 minutes
|
// This can take up to 2 seconds, so only do it every 10 minutes
|
||||||
static int64_t nLastPerfmon;
|
static int64_t nLastPerfmon;
|
||||||
if (GetTime() < nLastPerfmon + 10 * 60)
|
if (GetTime() < nLastPerfmon + 10 * 60)
|
||||||
return;
|
return;
|
||||||
nLastPerfmon = GetTime();
|
nLastPerfmon = GetTime();
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
// Don't need this on Linux, OpenSSL automatically uses /dev/urandom
|
|
||||||
// Seed with the entire set of perfmon data
|
|
||||||
std::vector<unsigned char> vData(250000, 0);
|
std::vector<unsigned char> vData(250000, 0);
|
||||||
long ret = 0;
|
long ret = 0;
|
||||||
unsigned long nSize = 0;
|
unsigned long nSize = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user