1
0
Fork 0
forked from lthn/blockchain

added additional check for incorrect asset operation type to get_or_calculate_asset_id()

This commit is contained in:
sowle 2024-08-13 01:10:22 +02:00
parent bc552ff635
commit 2c06293f24
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -2182,8 +2182,10 @@ namespace currency
return true;
}
// otherwise, calculate asset id
// otherwise, it must be a register operation
CHECK_AND_ASSERT_MES(ado.operation_type == ASSET_DESCRIPTOR_OPERATION_REGISTER, false, "unexpected asset operation type: " << (int)ado.operation_type << ", " << get_asset_operation_type_string(ado.operation_type));
// calculate asset id
crypto::hash_helper_t::hs_t hsc;
hsc.add_32_chars(CRYPTO_HDS_ASSET_ID);
hsc.add_hash(crypto::hash_helper_t::h(ado.descriptor.ticker));