Removing genesis_hash function since it can be directly queried easily.
This commit is contained in:
parent
1ac9679204
commit
91113e7d23
9 changed files with 10 additions and 18 deletions
|
@ -40,7 +40,7 @@ TEST (network_filter, unit)
|
|||
nano::state_block_builder builder;
|
||||
auto new_block = builder
|
||||
.account (nano::dev::genesis_key.pub)
|
||||
.previous (constants.genesis_hash ())
|
||||
.previous (constants.genesis->hash ())
|
||||
.representative (nano::dev::genesis_key.pub)
|
||||
.balance (nano::dev::genesis_amount - 10 * nano::xrb_ratio)
|
||||
.link (nano::public_key ())
|
||||
|
@ -70,7 +70,7 @@ TEST (network_filter, many)
|
|||
nano::state_block_builder builder;
|
||||
auto block = builder
|
||||
.account (nano::dev::genesis_key.pub)
|
||||
.previous (constants.genesis_hash ())
|
||||
.previous (constants.genesis->hash ())
|
||||
.representative (nano::dev::genesis_key.pub)
|
||||
.balance (nano::dev::genesis_amount - i * 10 * nano::xrb_ratio)
|
||||
.link (key1.pub)
|
||||
|
|
|
@ -577,7 +577,7 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map
|
|||
if (account == node.node->network_params.ledger.genesis_account ())
|
||||
{
|
||||
conf_height_reset_num = 1;
|
||||
node.node->store.confirmation_height.put (transaction, account, { confirmation_height_info.height, node.node->network_params.ledger.genesis_hash () });
|
||||
node.node->store.confirmation_height.put (transaction, account, { confirmation_height_info.height, node.node->network_params.ledger.genesis->hash () });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1307,7 +1307,7 @@ void reset_confirmation_heights (nano::write_transaction const & transaction, na
|
|||
|
||||
// Then make sure the confirmation height of the genesis account open block is 1
|
||||
nano::network_params network_params;
|
||||
store.confirmation_height.put (transaction, network_params.ledger.genesis_account (), { 1, network_params.ledger.genesis_hash () });
|
||||
store.confirmation_height.put (transaction, network_params.ledger.genesis_account (), { 1, network_params.ledger.genesis->hash () });
|
||||
}
|
||||
|
||||
bool is_using_rocksdb (boost::filesystem::path const & data_path, boost::program_options::variables_map const & vm, std::error_code & ec)
|
||||
|
|
|
@ -4146,7 +4146,7 @@ void nano::json_handler::version ()
|
|||
response_l.put ("node_vendor", boost::str (boost::format ("Nano %1%") % NANO_VERSION_STRING));
|
||||
response_l.put ("store_vendor", node.store.vendor_get ());
|
||||
response_l.put ("network", node.network_params.network.get_current_network_as_string ());
|
||||
response_l.put ("network_identifier", node.network_params.ledger.genesis_hash ().to_string ());
|
||||
response_l.put ("network_identifier", node.network_params.ledger.genesis->hash ().to_string ());
|
||||
response_l.put ("build_info", BUILD_INFO);
|
||||
response_errors ();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ bool nano::telemetry::verify_message (nano::telemetry_ack const & message_a, nan
|
|||
if (!remove_channel)
|
||||
{
|
||||
// Check for different genesis blocks
|
||||
remove_channel = (message_a.data.genesis_block != network_params.ledger.genesis_hash ());
|
||||
remove_channel = (message_a.data.genesis_block != network_params.ledger.genesis->hash ());
|
||||
if (remove_channel)
|
||||
{
|
||||
stats.inc (nano::stat::type::telemetry, nano::stat::detail::different_genesis_hash);
|
||||
|
@ -634,7 +634,7 @@ nano::telemetry_data nano::local_telemetry_data (nano::ledger const & ledger_a,
|
|||
telemetry_data.protocol_version = network_params_a.protocol.protocol_version;
|
||||
telemetry_data.uptime = std::chrono::duration_cast<std::chrono::seconds> (std::chrono::steady_clock::now () - statup_time_a).count ();
|
||||
telemetry_data.unchecked_count = ledger_a.store.unchecked.count (ledger_a.store.tx_begin_read ());
|
||||
telemetry_data.genesis_block = network_params_a.ledger.genesis_hash ();
|
||||
telemetry_data.genesis_block = network_params_a.ledger.genesis->hash ();
|
||||
telemetry_data.peer_count = nano::narrow_cast<decltype (telemetry_data.peer_count)> (network_a.size ());
|
||||
telemetry_data.account_count = ledger_a.cache.account_count;
|
||||
telemetry_data.major_version = nano::get_major_node_version ();
|
||||
|
|
|
@ -157,13 +157,6 @@ nano::account nano::ledger_constants::genesis_account () const
|
|||
return result;
|
||||
}
|
||||
|
||||
nano::block_hash nano::ledger_constants::genesis_hash () const
|
||||
{
|
||||
auto result = genesis->hash ();
|
||||
debug_assert (!result.is_zero ());
|
||||
return result;
|
||||
}
|
||||
|
||||
nano::random_constants::random_constants ()
|
||||
{
|
||||
nano::random_pool::generate_block (not_an_account.bytes.data (), not_an_account.bytes.size ());
|
||||
|
|
|
@ -369,7 +369,6 @@ public:
|
|||
ledger_constants (nano::network_constants & network_constants);
|
||||
ledger_constants (nano::networks network_a);
|
||||
nano::account genesis_account () const;
|
||||
nano::block_hash genesis_hash () const;
|
||||
nano::keypair zero_key;
|
||||
nano::account nano_beta_account;
|
||||
nano::account nano_live_account;
|
||||
|
|
|
@ -1342,7 +1342,7 @@ uint64_t nano::ledger::pruning_action (nano::write_transaction & transaction_a,
|
|||
{
|
||||
uint64_t pruned_count (0);
|
||||
nano::block_hash hash (hash_a);
|
||||
while (!hash.is_zero () && hash != network_params.ledger.genesis_hash ())
|
||||
while (!hash.is_zero () && hash != network_params.ledger.genesis->hash ())
|
||||
{
|
||||
auto block (store.block.get (transaction_a, hash));
|
||||
if (block != nullptr)
|
||||
|
|
|
@ -365,7 +365,7 @@ void nano::system::generate_rollback (nano::node & node_a, std::vector<nano::acc
|
|||
if (!error)
|
||||
{
|
||||
auto hash (info.open_block);
|
||||
if (hash != node_a.network_params.ledger.genesis_hash ())
|
||||
if (hash != node_a.network_params.ledger.genesis->hash ())
|
||||
{
|
||||
accounts_a[index] = accounts_a[accounts_a.size () - 1];
|
||||
accounts_a.pop_back ();
|
||||
|
|
|
@ -13,7 +13,7 @@ void nano::compare_default_telemetry_response_data_excluding_signature (nano::te
|
|||
ASSERT_EQ (telemetry_data_a.unchecked_count, 0);
|
||||
ASSERT_EQ (telemetry_data_a.account_count, 1);
|
||||
ASSERT_LT (telemetry_data_a.uptime, 100);
|
||||
ASSERT_EQ (telemetry_data_a.genesis_block, network_params_a.ledger.genesis_hash ());
|
||||
ASSERT_EQ (telemetry_data_a.genesis_block, network_params_a.ledger.genesis->hash ());
|
||||
ASSERT_EQ (telemetry_data_a.major_version, nano::get_major_node_version ());
|
||||
ASSERT_EQ (telemetry_data_a.minor_version, nano::get_minor_node_version ());
|
||||
ASSERT_EQ (telemetry_data_a.patch_version, nano::get_patch_node_version ());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue