aboutsummaryrefslogtreecommitdiff
path: root/src/random.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2015-02-26 09:42:24 +0100
committerWladimir J. van der Laan <[email protected]>2015-02-26 09:43:19 +0100
commit25d713c941d1a73597c90e4feed317660cb9af6d (patch)
treede5f7c057999f1b4d1c7785f848c2be2efae4a06 /src/random.cpp
parentMerge pull request #5708 (diff)
parentWIN32 Seed Cleanup: Move nLastPerfmon behind win32 ifdef. (diff)
downloaddiscoin-25d713c941d1a73597c90e4feed317660cb9af6d.tar.xz
discoin-25d713c941d1a73597c90e4feed317660cb9af6d.zip
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)
Diffstat (limited to 'src/random.cpp')
-rw-r--r--src/random.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/random.cpp b/src/random.cpp
index ae25bee1b..0ba0de908 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -47,15 +47,16 @@ void RandAddSeedPerfmon()
{
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
static int64_t nLastPerfmon;
if (GetTime() < nLastPerfmon + 10 * 60)
return;
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);
long ret = 0;
unsigned long nSize = 0;