HomePhabricator

[avalanche] initialize the avalanche processor only when avalanche is enabled

Description

[avalanche] initialize the avalanche processor only when avalanche is enabled

Summary:
And use the pointer to the processor in all the places that have access to it to determine whether avalanche is enabled.

Remove the responsibility for IsStakingRewardsActivated to check whether avalanche is activated. All the callsites for this function already check for the avalanche pointer or guarantee in some other way that the processor is initialized (use of EnsureAvalanche, places that have a reference to the processor instead of a pointer). This allows inlining the isAvalancheEnabled function in init.cpp

Depends on D16312

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Jun 7 2024, 07:30
teamcityPushed on Jun 7 2024, 19:02
Parents
rSTAGING9687e8a6dfcd: [avalanche] pass a fRelayProofs flag to the Peer struct
Branches
Unknown
Tags
Unknown

Event Timeline