Skip to content

Commit 2eb1540

Browse files
hebastoPastaPastaPasta
authored andcommitted
Merge bitcoin-core/gui#568: options: flip listenonion to false if not listening
7f90dc2 options: flip listenonion to false if not listening (Vasil Dimov) Pull request description: 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 ACKs for top commit: mzumsande: Tested ACK 7f90dc2 hebasto: ACK 7f90dc2 jonatack: utACK 7f90dc2 ryanofsky: Code review ACK 7f90dc2. Tree-SHA512: ff5095096858eae696293dc58d1cd5bd1bb60ef7c5d07d87308a0cf71c67da88cc00b301b550704625f136c4ba3a29905a934a766535a6422fe85d9662299d32
1 parent a0886c2 commit 2eb1540

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
@@ -266,8 +266,11 @@ void OptionsModel::Init(bool resetSettings)
266266

267267
if (!settings.contains("fListen"))
268268
settings.setValue("fListen", DEFAULT_LISTEN);
269-
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
269+
if (!gArgs.SoftSetBoolArg("-listen", settings.value("fListen").toBool())) {
270270
addOverriddenOption("-listen");
271+
} else if (!settings.value("fListen").toBool()) {
272+
gArgs.SoftSetBoolArg("-listenonion", false);
273+
}
271274

272275
if (!settings.contains("fUseProxy"))
273276
settings.setValue("fUseProxy", false);

0 commit comments

Comments
 (0)