aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-10-31 15:51:57 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-12-12 14:28:15 -0800
commit022cf47dd7ef8f46e32a184e84f94d1e9f3a495c (patch)
tree2e46f41779ed1e98cfc061ca73397b238b03b7b0 /src/test/test_bitcoin.h
parentfd3e7973ffaaa15ed32e5aeadcb02956849b8fc7 (diff)
Simplify testing RNG code
Diffstat (limited to 'src/test/test_bitcoin.h')
-rw-r--r--src/test/test_bitcoin.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h
index 182571b004..124f862de8 100644
--- a/src/test/test_bitcoin.h
+++ b/src/test/test_bitcoin.h
@@ -26,17 +26,11 @@ std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::os
return stream << static_cast<typename std::underlying_type<T>::type>(e);
}
-extern uint256 insecure_rand_seed;
extern FastRandomContext insecure_rand_ctx;
-static inline void SeedInsecureRand(bool fDeterministic = false)
+static inline void SeedInsecureRand(bool deterministic = false)
{
- if (fDeterministic) {
- insecure_rand_seed = uint256();
- } else {
- insecure_rand_seed = GetRandHash();
- }
- insecure_rand_ctx = FastRandomContext(insecure_rand_seed);
+ insecure_rand_ctx = FastRandomContext(deterministic);
}
static inline uint32_t InsecureRand32() { return insecure_rand_ctx.rand32(); }