add consistency check for unconfirmed txs with block after merging

This commit is contained in:
woodser
2023-09-01 17:19:34 -04:00
parent 8f91097667
commit f342ed9f5c
+4 -2
View File
@@ -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<monero_tx_wallet>& 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<std::shared_ptr<monero_tx_wallet>> txs = get_txs(*_query);
monero_utils::free(txs);
txs.clear();
txs = get_txs(*_query);
monero_utils::free(_query);
return txs;
}