HomePhabricator

[avalanche] remove unnecessary nullptr checks for g_avalanche

Description

[avalanche] remove unnecessary nullptr checks for g_avalanche

Summary:
m_max_avalanche_outbound is set to 0 if avalanche is disabled, so the check in net.cpp is redundant. This allows removing some setup code in net_tests.cpp that was working around this check in the context of unit tests when g_avalanche is not initialized.

The checks in init.cpp::AppInitMain() are redundant because they happen after

if (!g_avalanche) {
    InitError(avalancheError);
    return false;
}

Depends on D16256

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on May 30 2024, 12:54
teamcityPushed on May 31 2024, 06:20
Parents
rSTAGINGc8fabc010fdc: [avalanche] don't use global g_avalanche in net_processing
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/48065

Event Timeline