mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
core: ensure block size limit is set from the start
It can now be queried by RPC, so it needs to be set before it is otherwise needed for consensus, even if no blocks had to be added (ie, exit and restart quickly).
This commit is contained in:
parent
2806842200
commit
50b230d12c
1 changed files with 2 additions and 0 deletions
|
@ -375,6 +375,7 @@ bool Blockchain::init(BlockchainDB* db, const bool testnet, const cryptonote::te
|
||||||
LOG_PRINT_GREEN("Blockchain initialized. last block: " << m_db->height() - 1 << ", " << epee::misc_utils::get_time_interval_string(timestamp_diff) << " time ago, current difficulty: " << get_difficulty_for_next_block(), LOG_LEVEL_0);
|
LOG_PRINT_GREEN("Blockchain initialized. last block: " << m_db->height() - 1 << ", " << epee::misc_utils::get_time_interval_string(timestamp_diff) << " time ago, current difficulty: " << get_difficulty_for_next_block(), LOG_LEVEL_0);
|
||||||
m_db->block_txn_stop();
|
m_db->block_txn_stop();
|
||||||
|
|
||||||
|
update_next_cumulative_size_limit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
@ -532,6 +533,7 @@ bool Blockchain::reset_and_set_genesis_block(const block& b)
|
||||||
|
|
||||||
block_verification_context bvc = boost::value_initialized<block_verification_context>();
|
block_verification_context bvc = boost::value_initialized<block_verification_context>();
|
||||||
add_new_block(b, bvc);
|
add_new_block(b, bvc);
|
||||||
|
update_next_cumulative_size_limit();
|
||||||
return bvc.m_added_to_main_chain && !bvc.m_verifivation_failed;
|
return bvc.m_added_to_main_chain && !bvc.m_verifivation_failed;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue