Page MenuHomePhabricator

validation: Don't load a snapshot if it's not in the best header chain.
AcceptedPublic

Authored by PiRK on Wed, May 7, 13:43.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

If the snapshot is not an ancestor of the most-work header (m_best_header),
syncing from that alternative chain should be prioritised.
Therefore don't accept loading a snapshot in this situation.

If that other chain turns out to be invalid, m_best_header
would be reset and loading the snapshot should be possible again.

Because of the work required to generate a conflicting headers chain,
this should only be possible under extreme circumstances, such as major forks.

This is a backport of core#30320

Test Plan

ninja all check-all