Page MenuHomePhabricator

init: Remove Shutdown() node.args reset
AbandonedPublic

Authored by PiRK on Nov 24 2022, 09:43.

Details

Reviewers
None
Group Reviewers
Restricted Project
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 backport of core#15936 [2/3]
https://github.com/bitcoin/bitcoin/pull/15936/commits/77fabffef4ea840ee15c97061048fe8443d74658

Depends on D12604

Test Plan

ninja all check-all