HomePhabricator

refactor: Use reference instead of pointer in IsBlockPruned

Description

refactor: Use reference instead of pointer in IsBlockPruned

Summary:

This makes it harder to pass nullptr and cause issues such as
https://github.com/bitcoin/bitcoin/commit/dde7ac5c704688c8a9af29bd07e5ae8114824ce7

https://github.com/bitcoin/bitcoin/pull/29021/commits/fa5989d514d246e56977c528b2dd2abe6dc8efcc

refactor: Mark IsBlockPruned const

Member fields are used read-only in this method.

https://github.com/bitcoin/bitcoin/pull/30428/commits/aaaa3323f37526862ebf2a2a4bf522c661e6976e

This is a partial backport of core#29021 and core#30428
Depends on D18256

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>Authored on Dec 7 2023, 09:21
PiRKCommitted on Jun 17 2025, 09:20
PiRKPushed on Jun 17 2025, 09:20
Reviewer
Restricted Project
Differential Revision
D18257: refactor: Use reference instead of pointer in IsBlockPruned
Parents
rABCc5910098cce8: net: reduce LOCK(cs_main) scope in ProcessGetBlockData
Branches
Unknown
Tags
Unknown