HomePhabricator

[net processing] Annotate nUnconnectingHeaders as guarded by g_msgproc_mutex…

Description

[net processing] Annotate nUnconnectingHeaders 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/5f80d8d1eec14253407ceed1a813619d3e5a0fe4
https://github.com/bitcoin/bitcoin/pull/26140/commits/d8c0d1c345546c6066274edbf3bf4fb5d6f75419
Depends on D15288

Test Plan:
With Debug:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
dergoegge <n.goeggi@gmail.com>Authored on Sep 20 2022, 11:35
PiRKCommitted on Jan 26 2024, 17:17
PiRKPushed on Jan 26 2024, 17:17
Reviewer
Restricted Project
Differential Revision
D15289: [net processing] Annotate nUnconnectingHeaders as guarded by g_msgproc_mutex and move to Peer
Parents
rABC744681778e9f: [validation] Annotate ChainstateManager::m_best_header as guarded by cs_main
Branches
Unknown
Tags
Unknown