Skip to content

Commit 70f2c57

Browse files
vasildhebasto
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 Github-Pull: bitcoin-core/gui#568 Rebased-From: 7f90dc2
1 parent 642f272 commit 70f2c57

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
@@ -151,8 +151,11 @@ 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+
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool())) {
155155
addOverriddenOption("-listen");
156+
} else if (!settings.value("fListen").toBool()) {
157+
gArgs.SoftSetBoolArg("-listenonion", false);
158+
}
156159

157160
if (!settings.contains("server")) {
158161
settings.setValue("server", false);

0 commit comments

Comments
 (0)