Page MenuHomePhabricator

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

Authored by PiRK on May 31 2024, 16:10.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable