File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 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)
151151
152152 if (!settings.contains (" fListen" ))
153153 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)) {
155156 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
157174 gArgs .SoftSetBoolArg (" -listenonion" , false );
158175 }
159176
You can’t perform that action at this time.
0 commit comments