HomePhabricator

[net processing] Annotate fPreferHeaders as guarded by g_msgproc_mutex and move…

Description

[net processing] Annotate fPreferHeaders as guarded by g_msgproc_mutex and move to Peer

Summary:

nUnconnectingHeaders, m_headers_sync_timeout, fPreferHeaders and m_recently_announced_headers are currently all CNodeState members even though they are only ever accessed from the message processing thread (therefore sufficiently guarded exclusively by g_msgproc_mutex). CNodeState exists purely to hold validation-specific state guarded by cs_main that is accessed by multiple threads.

This is a partial backport of core#26140
https://github.com/bitcoin/bitcoin/pull/26140/commits/3605011e79d0d43ff532a2c3cc9cad4cc48eb06c
https://github.com/bitcoin/bitcoin/pull/26140/commits/8a2cb1f749ade31bb0655567cd0062db8a7164e5
Depends on D15290

Test Plan:
With Debug:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
dergoegge <n.goeggi@gmail.com>Authored on Sep 20 2022, 11:46
PiRKCommitted on Jan 26 2024, 17:17
PiRKPushed on Jan 26 2024, 17:17
Reviewer
Restricted Project
Differential Revision
D15291: [net processing] Annotate fPreferHeaders as guarded by g_msgproc_mutex and move to Peer
Parents
rABCa2bb882b90d4: [net processing] Annotate m_headers_sync_timeout as guarded by g_msgproc_mutex…
Branches
Unknown
Tags
Unknown