From f342ed9f5ce56b86da9cfe4a964cbfe96dbda659 Mon Sep 17 00:00:00 2001 From: woodser Date: Fri, 1 Sep 2023 07:29:51 -0400 Subject: [PATCH] add consistency check for unconfirmed txs with block after merging --- src/wallet/monero_wallet_full.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index eb3407b..93873a5 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -1809,9 +1809,11 @@ namespace monero { // special case: re-fetch txs if inconsistency caused by needing to make multiple wallet calls // TODO monero-project: offer wallet.get_txs(...) for (const std::shared_ptr& tx : txs) { - if (*tx->m_is_confirmed && tx->m_block == boost::none) { + if (*tx->m_is_confirmed && tx->m_block == boost::none || !*tx->m_is_confirmed & tx->m_block != boost::none) { std::cout << "WARNING: Inconsistency detected building txs from multiple wallet2 calls, re-fetching" << std::endl; - std::vector> txs = get_txs(*_query); + monero_utils::free(txs); + txs.clear(); + txs = get_txs(*_query); monero_utils::free(_query); return txs; }