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.
This commit is contained in:
Wladimir J. van der Laan
2017-02-22 08:02:50 +01:00
parent aa09ccbb74
commit 7cad849299
4 changed files with 42 additions and 28 deletions

View File

@@ -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