diff --git a/rai/secure.cpp b/rai/secure.cpp old mode 100644 new mode 100755 index f61c4ed5..516082a4 --- a/rai/secure.cpp +++ b/rai/secure.cpp @@ -100,7 +100,7 @@ std::string const & rai::rai_live_genesis (globals.rai_live_genesis); rai::account const & rai::genesis_account (globals.genesis_account); std::string const & rai::genesis_block (globals.genesis_block); rai::uint128_t const & rai::genesis_amount (globals.genesis_amount); -thread_local CryptoPP::AutoSeededRandomPool rai::random_pool; +thread_local CryptoPP::AutoSeededRandomPool & rai::random_pool (globals.random_pool); rai::block_hash const & rai::not_a_block (globals.not_a_block); rai::block_hash const & rai::not_an_account (globals.not_an_account); diff --git a/rai/utility.hpp b/rai/utility.hpp old mode 100644 new mode 100755 index c1eb9a64..b6e7cb3e --- a/rai/utility.hpp +++ b/rai/utility.hpp @@ -21,7 +21,9 @@ namespace rai { -extern thread_local CryptoPP::AutoSeededRandomPool random_pool; +// Random pool used by RaiBlocks. +// This must be thread_local as long as the AutoSeededRandomPool implementation requires it +extern thread_local CryptoPP::AutoSeededRandomPool & random_pool; // We operate on streams of uint8_t by convention using stream = std::basic_streambuf ; using bufferstream = boost::iostreams::stream_buffer >;