aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2022-03-23 11:25:19 +0100
committerVasil Dimov <vd@FreeBSD.org>2022-03-23 11:34:05 +0100
commit7f90dc26c8938f348938929b6d8bf1ea6f149209 (patch)
treecd0421073cdfb914746b425f14f4e11930a69ecc
parentd6f225f5c9f8382878e6970b707e57838e312f8c (diff)
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: https://github.com/bitcoin-core/gui/issues/567
-rw-r--r--src/qt/optionsmodel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 5d9ed5bf23..057767eb26 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -151,8 +151,11 @@ void OptionsModel::Init(bool resetSettings)
if (!settings.contains("fListen"))
settings.setValue("fListen", DEFAULT_LISTEN);
- if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
+ if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool())) {
addOverriddenOption("-listen");
+ } else if (!settings.value("fListen").toBool()) {
+ gArgs.SoftSetBoolArg("-listenonion", false);
+ }
if (!settings.contains("server")) {
settings.setValue("server", false);