1
0
Fork 0
forked from lthn/blockchain
This commit is contained in:
sowle 2021-04-28 21:26:23 +03:00
parent 85e46999c2
commit c4abdc39df
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
6 changed files with 9 additions and 9 deletions

View file

@ -1438,7 +1438,7 @@ bool blockchain_storage::create_block_template(const create_block_template_param
CRITICAL_REGION_BEGIN(m_read_lock);
height = m_db_blocks.size();
if(height <= m_core_runtime_config.hard_fork_01_starts_after_height)
b.major_version = BLOCK_MAJOR_VERSION_INITAL;
b.major_version = BLOCK_MAJOR_VERSION_INITIAL;
else if(height <= m_core_runtime_config.hard_fork_03_starts_after_height)
b.major_version = HF1_BLOCK_MAJOR_VERSION;
else
@ -5770,7 +5770,7 @@ bool blockchain_storage::is_after_hardfork_3_zone(uint64_t height)const
bool blockchain_storage::prevalidate_block(const block& bl)
{
//before hard_fork1
if (bl.major_version == BLOCK_MAJOR_VERSION_INITAL && get_block_height(bl) <= m_core_runtime_config.hard_fork_01_starts_after_height)
if (bl.major_version == BLOCK_MAJOR_VERSION_INITIAL && get_block_height(bl) <= m_core_runtime_config.hard_fork_01_starts_after_height)
return true;

View file

@ -232,7 +232,7 @@
//hard forks section
#define BLOCK_MAJOR_VERSION_GENESIS 1
#define BLOCK_MINOR_VERSION_GENESIS 0
#define BLOCK_MAJOR_VERSION_INITAL 0
#define BLOCK_MAJOR_VERSION_INITIAL 0
#ifndef TESTNET
#define ZANO_HARDFORK_01_AFTER_HEIGHT 194624
#define ZANO_HARDFORK_02_AFTER_HEIGHT 999999

View file

@ -1 +1 @@
*.user
*.user

View file

@ -222,10 +222,10 @@ bool test_generator::construct_block(currency::block& blk,
// if (height > m_hardfork_01_after_heigh)
// blk.major_version = CURRENT_BLOCK_MAJOR_VERSION;
// else
// blk.major_version = BLOCK_MAJOR_VERSION_INITAL;
// blk.major_version = BLOCK_MAJOR_VERSION_INITIAL;
if (height <= m_hardfork_01_after_heigh)
blk.major_version = BLOCK_MAJOR_VERSION_INITAL;
blk.major_version = BLOCK_MAJOR_VERSION_INITIAL;
else if (height <= m_hardfork_03_after_heigh)
blk.major_version = HF1_BLOCK_MAJOR_VERSION;
else
@ -878,7 +878,7 @@ bool test_generator::construct_block(int64_t manual_timestamp_adjustment,
size_t txs_sizes/* = 0*/)
{
size_t height = get_block_height(prev_block) + 1;
blk.major_version = actual_params & bf_major_ver ? major_ver : BLOCK_MAJOR_VERSION_INITAL;
blk.major_version = actual_params & bf_major_ver ? major_ver : BLOCK_MAJOR_VERSION_INITIAL;
blk.minor_version = actual_params & bf_minor_ver ? minor_ver : CURRENT_BLOCK_MINOR_VERSION;
blk.timestamp = actual_params & bf_timestamp ? timestamp : (height > 10 ? prev_block.timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN: prev_block.timestamp + DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN-POW_DIFF_UP_TIMESTAMP_DELTA); // Keep difficulty unchanged
blk.prev_id = actual_params & bf_prev_id ? prev_id : get_block_hash(prev_block);

View file

@ -24,7 +24,7 @@ void pos_block_builder::step1_init_header(size_t block_height, crypto::hash& pre
{
CHECK_AND_ASSERT_THROW_MES(m_step == 0, "pos_block_builder: incorrect step sequence");
m_block.minor_version = CURRENT_BLOCK_MINOR_VERSION;
m_block.major_version = BLOCK_MAJOR_VERSION_INITAL;
m_block.major_version = BLOCK_MAJOR_VERSION_INITIAL;
m_block.timestamp = 0; // to be set at step 3
m_block.prev_id = prev_block_hash;
m_block.flags = CURRENCY_BLOCK_FLAG_POS_BLOCK;

View file

@ -46,7 +46,7 @@ typedef std::vector<std::shared_ptr<tools::wallet2>> cct_wallets_t;
bool create_block_template_manually(const currency::block& prev_block, boost::multiprecision::uint128_t already_generated_coins, const std::vector<const currency::transaction*>& txs, const currency::account_public_address& miner_addr, currency::block& result)
{
result.flags = 0;
result.major_version = BLOCK_MAJOR_VERSION_INITAL;
result.major_version = BLOCK_MAJOR_VERSION_INITIAL;
result.minor_version = CURRENT_BLOCK_MINOR_VERSION;
result.nonce = 0;
result.prev_id = get_block_hash(prev_block);