Skip to content

Commit bca0337

Browse files
vasildjanus
authored andcommitted
options: flip listenonion to false if not listening
If the user has unchecked "Allow incoming connections" in `Settings->Options...->Network` then `fListen=false` is saved in `~/.config/Bitcoin/Bitcoin-Qt.conf`. This flips `-listen` to `false` during startup, but leaves `-listenonion` to `true`. This flipping of `-listen` is done in `OptionsModel::Init()` after `InitParameterInteraction()` has been executed which would have flipped `-listenonion`, should it have seen `-listen` being `false` (this is a difference between `bitcoind` and `bitcoin-qt`). Fixes: bitcoin-core/gui#567
1 parent a4bb0f5 commit bca0337

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/qt/optionsmodel.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ void OptionsModel::Init(bool resetSettings)
154154

155155
if (!settings.contains("fListen"))
156156
settings.setValue("fListen", DEFAULT_LISTEN);
157-
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
157+
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool())) {
158158
addOverriddenOption("-listen");
159+
} else if (!settings.value("fListen").toBool()) {
160+
gArgs.SoftSetBoolArg("-listenonion", false);
161+
}
159162

160163
if (!settings.contains("server")) {
161164
settings.setValue("server", false);

0 commit comments

Comments
 (0)