Ava Chow f5f853d952
Merge bitcoin/bitcoin#32878: index: fix wrong assert of current_tip == m_best_block_index
3aef38f44b76dfda77f47dc1a0e1fdc6ff3c7766 test: exercise index reorg assertion failure (furszy)
acf50233cdfbb336c87d95d97db90a149e131052 index: fix wrong assert of current_tip == m_best_block_index (Hao Xu)

Pull request description:

  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.

ACKs for top commit:
  achow101:
    ACK 3aef38f44b76dfda77f47dc1a0e1fdc6ff3c7766
  furszy:
    ACK 3aef38f
  mzumsande:
    Code Review ACK 3aef38f44b76dfda77f47dc1a0e1fdc6ff3c7766

Tree-SHA512: 3ef9cc6dfdec10a9f95d7414c6a11aa216e4cf5974440d80ab19fc919abd2a3bd4c875718c9dc94523c33826f8582ec5a016374deb8fb2d35cd2fb7799b5c82e
2025-08-19 12:19:52 -07:00
..
2024-07-08 11:12:01 +02:00