From bd129fe060e00ebb10d0ac304a0077369ff9a2a2 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 18 Aug 2020 16:55:12 -0400 Subject: [PATCH] throw error if destination amount or address not defined on create_txs() --- src/wallet/monero_wallet.h | 4 ++-- src/wallet/monero_wallet_core.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 1740ce9..e6df15c 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -383,12 +383,12 @@ namespace monero { } /** - * Get the blockchain's height by date. + * Get the blockchain's height by date as a conservative estimate for scanning. * * @param year - year of the height to get * @param month - month of the height to get as a number between 1 and 12 * @param day - day of the height to get as a number between 1 and 31 - * @return the blockchain's height at the given date + * @return the blockchain's approximate height at the given date */ virtual uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const { throw std::runtime_error("get_height_by_date(year, month, day) not supported"); diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index 0ff33d3..7f8b435 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -1698,6 +1698,8 @@ namespace monero { std::list tr_destinations; for (const std::shared_ptr& destination : config.get_normalized_destinations()) { tools::wallet_rpc::transfer_destination tr_destination; + if (destination->m_amount == boost::none) throw std::runtime_error("Destination amount not defined"); + if (destination->m_address == boost::none) throw std::runtime_error("Destination address not defined"); tr_destination.amount = destination->m_amount.get(); tr_destination.address = destination->m_address.get(); tr_destinations.push_back(tr_destination);