Fix #29767, set m_synced = true after Commit()

This commit is contained in:
nanlour 2024-04-01 14:13:06 +11:00
parent 61de64df67
commit bbe82c116e

View file

@ -162,9 +162,9 @@ void BaseIndex::Sync()
const CBlockIndex* pindex_next = WITH_LOCK(cs_main, return NextSyncBlock(pindex, m_chainstate->m_chain)); const CBlockIndex* pindex_next = WITH_LOCK(cs_main, return NextSyncBlock(pindex, m_chainstate->m_chain));
if (!pindex_next) { if (!pindex_next) {
SetBestBlockIndex(pindex); SetBestBlockIndex(pindex);
m_synced = true;
// No need to handle errors in Commit. See rationale above. // No need to handle errors in Commit. See rationale above.
Commit(); Commit();
m_synced = true;
break; break;
} }
if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) { if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) {