From e5adbab56ba69fb555f932581060c965a727d81b Mon Sep 17 00:00:00 2001 From: woodser Date: Sun, 5 Jun 2022 08:34:01 -0400 Subject: [PATCH] disallow subaddresses in monero_utils::get_integrated_subaddress --- src/utils/monero_utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/monero_utils.cpp b/src/utils/monero_utils.cpp index fd7c070..982dde3 100644 --- a/src/utils/monero_utils.cpp +++ b/src/utils/monero_utils.cpp @@ -69,6 +69,7 @@ monero_integrated_address monero_utils::get_integrated_address(monero_network_ty cryptonote::address_parse_info address_info; if (!get_account_address_from_str(address_info, static_cast(network_type), standard_address)) throw std::runtime_error("Invalid address"); if (address_info.has_payment_id) throw std::runtime_error("The given address already has a payment id"); + if (address_info.is_subaddress) throw std::runtime_error("Cannot create integrated address from subaddress"); // randomly generate payment id if not given, else validate crypto::hash8 payment_id_h8;