HomePhabricator

net_processing: move CNode data access out of lock

Description

net_processing: move CNode data access out of lock

Summary:
CNode::m_relays_tx and CNode::m_bloom_filter_loaded access don't require
the Peer::TxRelay::m_bloom_filter_mutex lock, so move them out of the
lock scope.

See https://github.com/bitcoin/bitcoin/pull/21160#discussion_r736785417
and https://github.com/bitcoin/bitcoin/pull/21160#discussion_r736785662.

Backport of core#24692
https://github.com/bitcoin/bitcoin/pull/24692/commits/21154ff9270e4bbae02d9012a4a73cce86a00334

Depends on D14711

Note that only one commit of that PR is applicable. The constness of peer in PushNodeVersion was fixed in D14710 and the fuzzers changes would require more fuzzer backports.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Mar 28 2022, 07:23
PiRKCommitted on Nov 1 2023, 16:54
PiRKPushed on Nov 1 2023, 16:54
Reviewer
Restricted Project
Differential Revision
D14712: net_processing: move CNode data access out of lock
Parents
rABC5143480f5ec8: scripted-diff: rename TxRelay & TxProof members
Branches
Unknown
Tags
Unknown