mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-28 05:56:33 +02:00
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>
This commit is contained in:
@@ -274,7 +274,6 @@ bool BaseIndex::Commit()
|
|||||||
|
|
||||||
bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_tip)
|
bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_tip)
|
||||||
{
|
{
|
||||||
assert(current_tip == m_best_block_index);
|
|
||||||
assert(current_tip->GetAncestor(new_tip->nHeight) == new_tip);
|
assert(current_tip->GetAncestor(new_tip->nHeight) == new_tip);
|
||||||
|
|
||||||
CBlock block;
|
CBlock block;
|
||||||
|
Reference in New Issue
Block a user