HomePhabricator

fix a couple of node.avalanche nullptr dereferencing

Description

fix a couple of node.avalanche nullptr dereferencing

Summary:
When avalanche is not initialized we should not pass it as a net events interface to CConnman::m_msgproc as the codebase never checks for nullptr before dereferencing these interfaces.

The node.avalanche->startEventLoop(*node.scheduler) obviously needs to be gated as well, or the node will not even start with -avalanche=0

Add a functional test that starts the node with avalanche=0 to catch these bugs. The first bug is caught by self.restart_node(1, extra_args=["-avalanche=0"]), the second bug related to net interface is caught by the block synchronization test.

Test Plan:
Check that this does not segfault src/bitcoind -regtest -avalanche=0

ninja all check-all
Check that without either one of the two fixes the new test crashes

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Jun 10 2024, 10:11
teamcityPushed on Jun 10 2024, 15:18
Parents
rSTAGING4e817a92a1a9: RPC: Accept options as named-only parameters
Branches
Unknown
Tags
Unknown

Event Timeline