diff --git a/src/wallet/monero_wallet_core.cpp b/src/wallet/monero_wallet_core.cpp index 7793a02..22dea89 100644 --- a/src/wallet/monero_wallet_core.cpp +++ b/src/wallet/monero_wallet_core.cpp @@ -1357,10 +1357,17 @@ namespace monero { vector> monero_wallet_core::get_txs() const { return get_txs(monero_tx_query()); } - + vector> monero_wallet_core::get_txs(const monero_tx_query& query) const { + vector missing_tx_hashes; + vector> txs = monero_wallet_core::get_txs(query, missing_tx_hashes); + if (!missing_tx_hashes.empty()) throw runtime_error("Tx not found in wallet: " + missing_tx_hashes[0]); + return txs; + } + + vector> monero_wallet_core::get_txs(const monero_tx_query& query, vector& missing_tx_hashes) const { MTRACE("get_txs(query)"); - + // copy and normalize tx query shared_ptr query_ptr = make_shared(query); // convert to shared pointer for copy shared_ptr _query = query_ptr->copy(query_ptr, make_shared()); // deep copy @@ -1447,7 +1454,7 @@ namespace monero { break; } } - if (!found) throw runtime_error("Tx not found in wallet: " + tx_hash); + if (!found) missing_tx_hashes.push_back(tx_hash); } } @@ -1466,6 +1473,7 @@ namespace monero { } txs = ordered_txs; } + return txs; } diff --git a/src/wallet/monero_wallet_core.h b/src/wallet/monero_wallet_core.h index d03f62a..0f2147f 100644 --- a/src/wallet/monero_wallet_core.h +++ b/src/wallet/monero_wallet_core.h @@ -217,6 +217,7 @@ namespace monero { monero_subaddress create_subaddress(uint32_t account_idx, const string& label = ""); vector> get_txs() const; vector> get_txs(const monero_tx_query& query) const; + vector> get_txs(const monero_tx_query& query, vector& missing_tx_hashes) const; vector> get_transfers(const monero_transfer_query& query) const; vector> get_outputs(const monero_output_query& query) const; string get_outputs_hex() const;