HomePhabricator

net: reduce LOCK(cs_main) scope in ProcessGetBlockData

Description

net: reduce LOCK(cs_main) scope in ProcessGetBlockData

Summary:
This also changes behavior if ReadBlockFromDisk or
ReadRawBlockFromDisk fails. Previously, the node would crash
due to an assert. This has been replaced with logging the error,
disconnecting the peer, and returning early.

This concludes backport of core#26326
https://github.com/bitcoin/bitcoin/pull/26326/commits/75d27fefc7a04ebdda7be5724a014b6a896e7325
Depends on D18255

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Andrew Toth <andrewstoth@gmail.com>Authored on May 4 2024, 19:38
PiRKCommitted on Jun 17 2025, 09:20
PiRKPushed on Jun 17 2025, 09:20
Reviewer
Restricted Project
Differential Revision
D18256: net: reduce LOCK(cs_main) scope in ProcessGetBlockData
Parents
rABCca505b1524f0: net: reduce LOCK(cs_main) scope in GETBLOCKTXN
Branches
Unknown
Tags
Unknown