HomePhabricator

init: Remove Shutdown() node.args reset

Description

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Apr 29 2019, 19:29
PiRKCommitted on Jan 4 2024, 14:05
PiRKPushed on Jan 4 2024, 14:05
Reviewer
Restricted Project
Differential Revision
D15066: init: Remove Shutdown() node.args reset
Parents
rABCaf12c92a5334: settings: Add update/getPersistent/isIgnored methods
Branches
Unknown
Tags
Unknown