forked from lthn/blockchain
attempt to fix wallet exception on alt blocks
This commit is contained in:
parent
4c2553a482
commit
fd25b5a8e5
1 changed files with 13 additions and 0 deletions
|
|
@ -522,6 +522,13 @@ void wallet2::add_to_last_zc_global_indexs(uint64_t h, uint64_t last_zc_output_i
|
|||
}
|
||||
else
|
||||
{
|
||||
//@#@
|
||||
#ifdef _DEBUG
|
||||
if (m_last_zc_global_indexs.begin()->second > last_zc_output_index)
|
||||
{
|
||||
LOG_ERROR("!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
#endif
|
||||
//equals, same h but new last_zc_output_index, just update it, should be always bigger then prev
|
||||
WLT_THROW_IF_FALSE_WITH_CODE(m_last_zc_global_indexs.begin()->second <= last_zc_output_index,
|
||||
"condition m_last_zc_global_indexs.begin()->second " << m_last_zc_global_indexs.begin()->second << " <= last_zc_output_index " << last_zc_output_index << " failed", API_RETURN_CODE_INTERNAL_ERROR);
|
||||
|
|
@ -3072,6 +3079,12 @@ void wallet2::detach_blockchain(uint64_t including_height)
|
|||
++it;
|
||||
}
|
||||
|
||||
//detach in m_last_zc_global_indexs
|
||||
while (m_last_zc_global_indexs.size() && including_height <= m_last_zc_global_indexs.begin()->first )
|
||||
{
|
||||
m_last_zc_global_indexs.erase(m_last_zc_global_indexs.begin());
|
||||
}
|
||||
|
||||
//asset descriptors
|
||||
handle_rollback_events(including_height);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue