don't check connection in get_txs()

This commit is contained in:
woodser
2023-04-14 12:34:04 -04:00
parent 2c48ea67b1
commit a6bd4b8c2e
+6 -6
View File
@@ -3538,14 +3538,9 @@ namespace monero {
subaddress_indices.insert(_query->m_subaddress_indices[i]);
}
// check if pool txs explicitly requested without daemon connection
if (tx_query->m_in_tx_pool != boost::none && tx_query->m_in_tx_pool.get() && !is_connected_to_daemon()) {
throw std::runtime_error("Cannot fetch pool transactions because wallet has no daemon connection");
}
// translate from monero_tx_query to in, out, pending, pool, failed terminology used by monero-wallet-rpc
bool can_be_confirmed = !bool_equals(false, tx_query->m_is_confirmed) && !bool_equals(true, tx_query->m_in_tx_pool) && !bool_equals(true, tx_query->m_is_failed) && !bool_equals(false, tx_query->m_is_relayed);
bool can_be_in_tx_pool = is_connected_to_daemon() && !bool_equals(true, tx_query->m_is_confirmed) && !bool_equals(false, tx_query->m_in_tx_pool) && !bool_equals(true, tx_query->m_is_failed) && !bool_equals(false, tx_query->m_is_relayed) && tx_query->get_height() == boost::none && tx_query->m_min_height == boost::none && !bool_equals(false, tx_query->m_is_locked);
bool can_be_in_tx_pool = !bool_equals(true, tx_query->m_is_confirmed) && !bool_equals(false, tx_query->m_in_tx_pool) && !bool_equals(true, tx_query->m_is_failed) && tx_query->get_height() == boost::none && tx_query->m_min_height == boost::none && !bool_equals(false, tx_query->m_is_locked);
bool can_be_incoming = !bool_equals(false, _query->m_is_incoming) && !bool_equals(true, _query->is_outgoing()) && !bool_equals(true, _query->m_has_destinations);
bool can_be_outgoing = !bool_equals(false, _query->is_outgoing()) && !bool_equals(true, _query->m_is_incoming);
bool is_in = can_be_incoming && can_be_confirmed;
@@ -3554,6 +3549,11 @@ namespace monero {
bool is_pool = can_be_incoming && can_be_in_tx_pool;
bool is_failed = !bool_equals(false, tx_query->m_is_failed) && !bool_equals(true, tx_query->m_is_confirmed) && !bool_equals(true, tx_query->m_in_tx_pool) && !bool_equals(false, tx_query->m_is_locked);
// check if fetching pool txs contradicted by configuration
if (tx_query->m_in_tx_pool != boost::none && tx_query->m_in_tx_pool.get() && !can_be_in_tx_pool) {
throw std::runtime_error("Cannot fetch pool transactions because it contradicts configuration");
}
// cache unique txs and blocks
uint64_t height = get_height();
std::map<std::string, std::shared_ptr<monero_tx_wallet>> tx_map;