throw error if destination amount or address not defined on create_txs()

This commit is contained in:
woodser
2020-08-18 16:55:12 -04:00
parent c34c9d8429
commit bd129fe060
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -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");
+2
View File
@@ -1698,6 +1698,8 @@ namespace monero {
std::list<tools::wallet_rpc::transfer_destination> tr_destinations;
for (const std::shared_ptr<monero_destination>& 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);