1
0
Fork 0
forked from lthn/blockchain

fixed few bugs related to aliases registration and block versions

This commit is contained in:
cryptozoidberg 2023-04-26 23:59:33 +02:00
parent 4cfb62575b
commit 64a043a18f
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 8 additions and 13 deletions

View file

@ -6409,15 +6409,7 @@ bool blockchain_storage::prevalidate_block(const block& bl)
return true;
}
// HF3
if ( m_core_runtime_config.is_hardfork_active_for_height(3, block_height) &&
!m_core_runtime_config.is_hardfork_active_for_height(4, block_height))
{
CHECK_AND_ASSERT_MES(bl.major_version == HF3_BLOCK_MAJOR_VERSION, false, "HF3, incorrect block major version: " << (int)bl.major_version);
}
//after hard_fork3
// >= HF3
if (bl.major_version > CURRENT_BLOCK_MAJOR_VERSION)
{
LOG_ERROR("prevalidation failed for block " << get_block_hash(bl) << ": major block version " << static_cast<size_t>(bl.major_version) << " is incorrect, " << CURRENT_BLOCK_MAJOR_VERSION << " is expected" << ENDL

View file

@ -3533,7 +3533,7 @@ namespace currency
}
if (p_amount_burnt)
*p_amount_burnt = sum_of_bare_outs_burnt;
return sum_of_bare_outs_burnt == amount;
return sum_of_bare_outs_burnt >= amount;
}
// post HF-4 txs

View file

@ -2228,7 +2228,10 @@ bool shuffle_source_entries(std::vector<tx_source_entry>& sources)
//------------------------------------------------------------------------------
test_chain_unit_base::test_chain_unit_base()
{
m_hardforks = get_default_core_runtime_config().hard_forks; // set default hardforks for tests (will be overriden by test if necessary)
}
void test_chain_unit_base::register_callback(const std::string& cb_name, verify_callback cb)
{
m_callbacks[cb_name] = cb;
@ -2286,8 +2289,6 @@ test_chain_unit_enchanced::test_chain_unit_enchanced()
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, check_offers_count);
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, check_hardfork_active);
REGISTER_CALLBACK_METHOD(test_chain_unit_enchanced, check_hardfork_inactive);
m_hardforks = get_default_core_runtime_config().hard_forks; // set default hardforks for tests (will be overriden by test if necessary)
}
bool test_chain_unit_enchanced::configure_core(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events)

View file

@ -230,6 +230,8 @@ class test_generator;
class test_chain_unit_base
{
public:
test_chain_unit_base();
typedef boost::function<bool(currency::core& c, size_t ev_index, const std::vector<test_event_entry> &events)> verify_callback;
typedef std::map<std::string, verify_callback> callbacks_map;