From 3030e3ecff79a59bf05d5eb9db84799ae4a4ef44 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 29 Nov 2015 11:41:37 +0000 Subject: [PATCH] wallet2: remove confirmed transactions from detached blocks --- src/wallet/wallet2.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a6ac860c..2e01101d 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -685,6 +685,14 @@ void wallet2::detach_blockchain(uint64_t height) ++it; } + for (auto it = m_confirmed_txs.begin(); it != m_confirmed_txs.end(); ) + { + if(height <= it->second.m_block_height) + it = m_confirmed_txs.erase(it); + else + ++it; + } + LOG_PRINT_L0("Detached blockchain on height " << height << ", transfers detached " << transfers_detached << ", blocks detached " << blocks_detached); } //----------------------------------------------------------------------------------------------------