HomePhabricator

[avalanche] pass a reference to the avalanche processor to StakingRewardsPolicy

Description

[avalanche] pass a reference to the avalanche processor to StakingRewardsPolicy

Summary:
This removes a few callsites for the global g_avalanche. It makes sense to assume that a StakingRewardPolicy should be used only when the processor is initialized, passing a reference instead of invoking a pointer makes that a hard rule.

Note that the is IsStakingRewardsActivated function is always called after we already checked for g_avalanche in non-test code, so there is no change in behavior by removing that check. And this allows removing some setup code in stakingrewards_tests.cpp

Depends on D16259

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on May 31 2024, 16:04
PiRKPushed on Jun 3 2024, 13:31
Reviewer
Restricted Project
Differential Revision
D16260: [avalanche] pass a reference to the avalanche processor to StakingRewardsPolicy
Parents
rABC8e839c67d4b9: validation: deduplicate forward declaration of Consensus::Params
Branches
Unknown
Tags
Unknown