HomePhabricator

index: Don't commit a best block before indexing it during sync

Description

index: Don't commit a best block before indexing it during sync

Summary:
Committing a block prior to indexing would leave the index database
in an inconsistent state until it is indexed, which could corrupt the
index in case of a unclean shutdown. Thus commit its predecessor.

Co-authored-by: Luke Dashjr <luke-jr+git@utopios.org>
This is a backport of core#25074

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, roqqit

Reviewed By: #bitcoin_abc, roqqit

Differential Revision: https://reviews.bitcoinabc.org/D17702

Details

Provenance
Martin Zumsande <mzumsande@gmail.com>Authored on May 6 2022, 12:07
PiRKCommitted on Wed, Feb 26, 16:54
PiRKPushed on Wed, Feb 26, 16:54
Reviewer
Restricted Project
Differential Revision
D17702: index: Don't commit a best block before indexing it during sync
Parents
rABC251c3b16b672: [avalanche] Clarify and simplify checking polled contenders
Branches
Unknown
Tags
Unknown