Skip to content

Commit acf5023

Browse files
author
Hao Xu
committed
index: fix wrong assert of current_tip == m_best_block_index
In BaseIndex::Sync(), pindex in `Rewind(pindex, pindex_next->pprev)` isn't always equal to m_best_block_index since m_best_block_index is updated every SYNC_LOCATOR_WRITE_INTERVAL seconds, during which multiple pindex update could happen. Thus the assert here is wrong. Signed-off-by: Hao Xu <hao.xu@linux.dev>
1 parent 75ed673 commit acf5023

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/index/base.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ bool BaseIndex::Commit()
274274

275275
bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_tip)
276276
{
277-
assert(current_tip == m_best_block_index);
278277
assert(current_tip->GetAncestor(new_tip->nHeight) == new_tip);
279278

280279
CBlock block;

0 commit comments

Comments
 (0)