fix(qt): re-run parameter interactions after setting prune settings on first-run #6367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Additional Information
The bug reported in #6366 can be reproduced by deleting
~/.config/*/Dash-Qt*.confand runningdash-qt(the decision on whether to display the splash screen is based on Qt settings, which are read before datadir).This bug has been reproduced on
develop(f211bb9) and as early as v20.0.4 (the ability to enable pruning was introduced in #5255).The bug occurs we're given two opportunities to disable of
-txindexand enable of-disablegovernanceif-pruneis set,InitParameterInteraction()(source) (viaBitcoinApplication::parameterSetup(), source) andOptionsModel::Init()(source) but both opportunities are exhausted before we set the-pruneflag in response to enabling the option in the UI (source).We cannot simply just move
BitcoinApplication::InitPruneSetting()up as it assumesOptionsModelis initialized andOptionsModel::Init()is called from the constructor.This means when arguments are parsed for the last time, we get our "Prune mode is incompatible with -txindex" (source) because our parameter interactions took place before prune settings were set.
This PR resolves that by running
BitcoinApplication::parameterSetup()again afterBitcoinApplication::InitPruneSetting(). We do this instead of usingOptionsModel::Init()as all theSoftSet{Bool}Arg()failures will result in an unnaturally populated overridden arguments list.Breaking Changes
None expected
Checklist