diff --git a/rai/secure.cpp b/rai/secure.cpp index 842e7507..3e6d08e9 100644 --- a/rai/secure.cpp +++ b/rai/secure.cpp @@ -61,6 +61,9 @@ genesis_account (rai::rai_network == rai::rai_networks::rai_test_network ? rai_t genesis_block (rai::rai_network == rai::rai_networks::rai_test_network ? rai_test_genesis : rai::rai_network == rai::rai_networks::rai_beta_network ? rai_beta_genesis : rai_live_genesis), genesis_amount (std::numeric_limits ::max ()) { + // Randomly generating these mean no two nodes will ever have the same sentinal values which protects against some insecure algorithms + rai::random_pool.GenerateBlock (not_a_block.bytes.data (), not_a_block.bytes.size ()); + rai::random_pool.GenerateBlock (not_an_account.bytes.data (), not_an_account.bytes.size ()); } rai::keypair zero_key; rai::keypair test_genesis_key; @@ -74,6 +77,8 @@ rai::account genesis_account; std::string genesis_block; rai::uint128_t genesis_amount; CryptoPP::AutoSeededRandomPool random_pool; +rai::block_hash not_a_block; +rai::account not_an_account; }; ledger_constants globals; } @@ -96,6 +101,8 @@ 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); 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); boost::filesystem::path rai::working_path () { @@ -163,7 +170,7 @@ std::map , std::greater