diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-05-23 17:53:00 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-05-23 18:45:28 +0200 |
commit | 15254e907e8c5c1fa4415ecb94ddb8330a4c2868 (patch) | |
tree | dd5f482803e2de22a6853ba572eca35bf42acd1e /src/scheduler.cpp | |
parent | e76a3927c3b0a6d6a0fc84ef9144540ebecd1bf2 (diff) | |
parent | 888cce57a67c901b89c86cc645f275071d021285 (diff) | |
download | bitcoin-15254e907e8c5c1fa4415ecb94ddb8330a4c2868.tar.xz |
Merge #10372: Add perf counter data to GetStrongRandBytes state in scheduler
888cce5 Add perf counter data to GetStrongRandBytes state in scheduler (Matt Corallo)
399fb8f Add internal method to add new random data to our internal RNG state (Matt Corallo)
Tree-SHA512: 9732a3804d015eaf48d56b60c73880014845fd17a098f1ac2eff6bd50a4beb8b8be65956ac1f0d641e96e3a53c17daddd919401edbf2e3797c3fb687730fb913
Diffstat (limited to 'src/scheduler.cpp')
-rw-r--r-- | src/scheduler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 0c1cfa2718..923ba2c231 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -4,6 +4,7 @@ #include "scheduler.h" +#include "random.h" #include "reverselock.h" #include <assert.h> @@ -39,6 +40,11 @@ void CScheduler::serviceQueue() // is called. while (!shouldStop()) { try { + if (!shouldStop() && taskQueue.empty()) { + reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock); + // Use this chance to get a tiny bit more entropy + RandAddSeedSleep(); + } while (!shouldStop() && taskQueue.empty()) { // Wait until there is something to do. newTaskScheduled.wait(lock); |