diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ac486389..5bcfa40c 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2116,6 +2116,12 @@ void wallet2::handle_pulled_blocks(size_t& blocks_added, std::atomic& stop } else { + //if first synchronized block in the wallet accidently became orphaned we need to force wallet to resync + if(this->m_minimum_height == height) + { + full_reset_needed = true; + } + //this should happen ONLY after block been matched, if not then is internal error if (full_reset_needed) { diff --git a/src/wallet/wallet_chain_shortener.cpp b/src/wallet/wallet_chain_shortener.cpp index 77c5d82c..39d37c75 100644 --- a/src/wallet/wallet_chain_shortener.cpp +++ b/src/wallet/wallet_chain_shortener.cpp @@ -217,7 +217,7 @@ void wallet_chain_shortener::check_if_block_matched(uint64_t i, const crypto::ha } return; } - if (!m_last_20_blocks.empty() && i > m_last_20_blocks.begin()->first) + if (!m_last_20_blocks.empty() && i >= m_last_20_blocks.begin()->first) { //must be in short sequence (m_last_20_blocks) //self check