HomePhabricator

[avalanche] Record peers that have avalanche enabled

Description

[avalanche] Record peers that have avalanche enabled

Summary:
m_avalanche_state is currently serving a dual purpose: to store state of peers that have been polled
and to determine if a peer supports avalanche. This patch splits those responsibilities apart so that
the latter is recorded as a new state m_avalanche_enabled. This will become more relevant as additional
refactors are done to fix a TSAN data race related to m_avalanche_state.

There is no change in behavior.

This patch also includes some refactors and redundant checks to make the code easier to understand and
refactor further.

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
sdulfariAuthored on Oct 20 2022, 02:29
sdulfariPushed on Oct 24 2022, 15:57
Reviewer
Restricted Project
Differential Revision
D12325: [avalanche] Record peers that have avalanche enabled
Parents
rABC181d570e4a3c: test: avoid non-determinism in asmap-addrman test
Branches
Unknown
Tags
Unknown