forked from lthn/blockchain
fixed few bugs related to aliases registration and block versions
This commit is contained in:
parent
4cfb62575b
commit
64a043a18f
4 changed files with 8 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue