aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-02-22 08:02:50 +0100
committerWladimir J. van der Laan <[email protected]>2017-02-22 08:02:50 +0100
commit7cad84929907c4294f07377453aa77887911b486 (patch)
treea364b2912656b00dac9e397f767d6df1fd91e821 /src/random.h
parentsquashme: comment that NUM_OS_RANDOM_BYTES should not be changed lightly (diff)
downloaddiscoin-7cad84929907c4294f07377453aa77887911b486.tar.xz
discoin-7cad84929907c4294f07377453aa77887911b486.zip
sanity: Move OS random to sanity check function
Move the OS random test to a sanity check function that is called every time bitcoind is initialized. Keep `src/test/random_tests.cpp` for the case that later random tests are added, and keep a rudimentary test that just calls the sanity check.
Diffstat (limited to 'src/random.h')
-rw-r--r--src/random.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/random.h b/src/random.h
index 29de58731..0464bdce1 100644
--- a/src/random.h
+++ b/src/random.h
@@ -58,4 +58,9 @@ static const ssize_t NUM_OS_RANDOM_BYTES = 32;
*/
void GetOSRand(unsigned char *ent32);
+/** Check that OS randomness is available and returning the requested number
+ * of bytes.
+ */
+bool Random_SanityCheck();
+
#endif // BITCOIN_RANDOM_H