HomePhabricator

[avalanche] Fix a data race where updating availability scores can coincide…

Description

[avalanche] Fix a data race where updating availability scores can coincide with initialization of state

Summary:
There is a data race where UpdateAvalancheStatistics() may be called while
m_avalanche_state is being initialized. This patch refactors out the
AvalancheState container which is not that useful since it only saves a few
bytes per peer that does not respond to avalanche polls. The resulting design
is simpler and less error prone.

Depends on D12325

Test Plan:

ninja check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
sdulfariAuthored on Oct 21 2022, 17:44
sdulfariPushed on Oct 25 2022, 17:27
Reviewer
Restricted Project
Differential Revision
D12355: [avalanche] Fix a data race where updating availability scores can coincide with initialization of state
Parents
rABCf61f449edd7d: test: a test to check descendant limits
Branches
Unknown
Tags
Unknown