From d3a4db9e370308cc3c875bd36274d56432682a0e Mon Sep 17 00:00:00 2001 From: sowle Date: Sun, 7 Jul 2024 20:39:22 +0200 Subject: [PATCH] set upper limit for the decimal point to to 18 in wallet2::deploy_new_asset() --- src/wallet/wallet2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a4d8f950..a8f31327 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5305,6 +5305,8 @@ void wallet2::request_alias_registration(currency::extra_alias_entry& ai, curren //---------------------------------------------------------------------------------------------------- void wallet2::deploy_new_asset(const currency::asset_descriptor_base& asset_info, const std::vector& destinations, currency::transaction& result_tx, crypto::public_key& new_asset_id) { + WLT_THROW_IF_FALSE_WALLET_CMN_ERR_EX(asset_info.decimal_point <= 18, "too big decimal point: " << asset_info.decimal_point); + asset_descriptor_operation asset_reg_info = AUTO_VAL_INIT(asset_reg_info); asset_reg_info.descriptor = asset_info; asset_reg_info.operation_type = ASSET_DESCRIPTOR_OPERATION_REGISTER;