1
0
Fork 0
forked from lthn/blockchain

new core rule: new format tx_payer, tx_receiver and extra_alias_entry are not allowed before HF2

This commit is contained in:
sowle 2020-05-19 20:22:53 +03:00
parent 884d068274
commit cfdd8bdc9c
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -4601,6 +4601,26 @@ bool blockchain_storage::validate_tx_for_hardfork_specific_terms(const transacti
return true;
}
if (block_height <= m_core_runtime_config.hard_fork_02_starts_after_height)
{
// before hardfork 2
auto check_lambda = [&](const std::vector<payload_items_v>& container) -> bool
{
for (const auto& el : container)
{
const auto& type = el.type();
CHECK_AND_ASSERT_MES(type != typeid(tx_payer), false, "tx " << tx_id << " contains tx_payer which is not allowed on height " << block_height);
CHECK_AND_ASSERT_MES(type != typeid(tx_receiver), false, "tx " << tx_id << " contains tx_receiver which is not allowed on height " << block_height);
CHECK_AND_ASSERT_MES(type != typeid(extra_alias_entry), false, "tx " << tx_id << " contains extra_alias_entry which is not allowed on height " << block_height);
}
return true;
};
return check_lambda(tx.extra) && check_lambda(tx.attachment);
}
return true;
}
//------------------------------------------------------------------