HomePhabricator

p2p: Restrict downloading of blocks for snapshot chain

Description

p2p: Restrict downloading of blocks for snapshot chain

Summary:
If the best chain of the peer doesn't include the snapshot
block, it is futile to download blocks from this chain,
because we couldn't reorg to it. We'd also crash
trying to reorg because this scenario is not handled.

This is a partial backport of core#29519
https://github.com/bitcoin/bitcoin/pull/29519/commits/7a885518d57c6eb818ebef5fd04a575f324ee8b2

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Martin Zumsande <mzumsande@gmail.com>Authored on Aug 11 2025, 12:09
PiRKCommitted on Aug 11 2025, 12:10
PiRKPushed on Aug 11 2025, 12:10
Reviewer
Restricted Project
Differential Revision
D18455: p2p: Restrict downloading of blocks for snapshot chain
Parents
rABC287640f183f2: Do not use std::vector = {} to release memory
Branches
Unknown
Tags
Unknown