Merge pull request #3982

08b85a8 cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X (stoffu)
0cf80ba net_node: resolve host for node addresses given via command line flags (stoffu)
This commit is contained in:
luigi1111 2018-06-27 15:38:23 -05:00
commit 3ad4ecd4ff
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
6 changed files with 113 additions and 57 deletions

View file

@ -394,18 +394,7 @@ bool Blockchain::init(BlockchainDB* db, const network_type nettype, bool offline
MINFO("Blockchain not loaded, generating genesis block.");
block bl = boost::value_initialized<block>();
block_verification_context bvc = boost::value_initialized<block_verification_context>();
if (m_nettype == TESTNET)
{
generate_genesis_block(bl, config::testnet::GENESIS_TX, config::testnet::GENESIS_NONCE);
}
else if (m_nettype == STAGENET)
{
generate_genesis_block(bl, config::stagenet::GENESIS_TX, config::stagenet::GENESIS_NONCE);
}
else
{
generate_genesis_block(bl, config::GENESIS_TX, config::GENESIS_NONCE);
}
generate_genesis_block(bl, get_config(m_nettype).GENESIS_TX, get_config(m_nettype).GENESIS_NONCE);
add_new_block(bl, bvc);
CHECK_AND_ASSERT_MES(!bvc.m_verifivation_failed, false, "Failed to add genesis block to blockchain");
}