forked from lthn/blockchain
wallet: fixed a bug when a freshly created wallet's node is in then-become alt-chain (credits to @cryptozoidberg)
This commit is contained in:
parent
467fd4b6ba
commit
8fc70f4d6d
2 changed files with 7 additions and 1 deletions
|
|
@ -2116,6 +2116,12 @@ void wallet2::handle_pulled_blocks(size_t& blocks_added, std::atomic<bool>& 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue