Page MenuHomePhabricator

init: Remove Shutdown() node.args reset
ClosedPublic

Authored by PiRK on Jan 3 2024, 10:05.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC012cad14f46c: init: Remove Shutdown() node.args reset
Summary

This commit removes the node.args = nullptr assignment in the Shutdown()
function.

Clearing node.args there never made sense because it made the
Shutdown() function not idempotent, making it fragile and causing issues like
https://github.com/bitcoin/bitcoin/issues/23186.

The assignment also causes segfaults in GUI unit tests when a new
node().initParameterInteraction() call is added in OptionsModel to apply to Qt
settings (happens because AppTests calls Shutdown() which sets node.args to
null, and OptionTests runs after AppTests and then needs node.args not to be
null.)

This is a partial backport of core#15936
https://github.com/bitcoin/bitcoin/pull/15936/commits/77fabffef4ea840ee15c97061048fe8443d74658

Depends on D15065

Test Plan

ninja all check-all

Diff Detail

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