From 7be88657551ed11c11ab3ebc31a269c4041cefb9 Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 8 Apr 2024 18:31:06 +0200 Subject: [PATCH] wallet2: fixed add_to_last_zc_global_indexs() --- src/wallet/wallet2.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 6fc49d2e..964d2e76 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -504,16 +504,14 @@ void wallet2::add_rollback_event(uint64_t h, const wallet_event_t& ev) #define M_LAST_ZC_GLOBAL_INDEXS_MAX_SIZE 30 void wallet2::add_to_last_zc_global_indexs(uint64_t h, uint64_t last_zc_output_index) { - //m_last_zc_global_indexs.remove_if_expiration_less_than(m_last_known_daemon_height - (WALLET_DEFAULT_TX_SPENDABLE_AGE * 2) ); - if (m_last_zc_global_indexs.size()) { - if (m_last_zc_global_indexs.begin()->first > h) + if (h > m_last_zc_global_indexs.begin()->first) { //new block added on top of last one, simply add new record m_last_zc_global_indexs.push_front(std::make_pair(h, last_zc_output_index)); } - else if (m_last_zc_global_indexs.begin()->first < h) + else if (h < m_last_zc_global_indexs.begin()->first) { //looks like reorganize, pop all records before while (m_last_zc_global_indexs.size() && m_last_zc_global_indexs.begin()->first >= h)