Commit 3b82608 1 parent 0a14a16 commit 3b82608 Copy full SHA for 3b82608
File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,26 @@ void OptionsModel::Init(bool resetSettings)
151
151
152
152
if (!settings.contains (" fListen" ))
153
153
settings.setValue (" fListen" , DEFAULT_LISTEN);
154
- if (!gArgs .SoftSetBoolArg (" -listen" , settings.value (" fListen" ).toBool ())) {
154
+ const bool listen{settings.value (" fListen" ).toBool ()};
155
+ if (!gArgs .SoftSetBoolArg (" -listen" , listen)) {
155
156
addOverriddenOption (" -listen" );
156
- } else if (!settings.value (" fListen" ).toBool ()) {
157
+ } else if (!listen) {
158
+ // We successfully set -listen=0, thus mimic the logic from InitParameterInteraction():
159
+ // "parameter interaction: -listen=0 -> setting -listenonion=0".
160
+ //
161
+ // Both -listen and -listenonion default to true.
162
+ //
163
+ // The call order is:
164
+ //
165
+ // InitParameterInteraction()
166
+ // would set -listenonion=0 if it sees -listen=0, but for bitcoin-qt with
167
+ // fListen=false -listen is 1 at this point
168
+ //
169
+ // OptionsModel::Init()
170
+ // (this method) can flip -listen from 1 to 0 if fListen=false
171
+ //
172
+ // AppInitParameterInteraction()
173
+ // raises an error if -listen=0 and -listenonion=1
157
174
gArgs .SoftSetBoolArg (" -listenonion" , false );
158
175
}
159
176
You can’t perform that action at this time.
0 commit comments