mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-03 18:06:55 +02:00
Merge bitcoin-core/gui#568: options: flip listenonion to false if not listening
7f90dc26c8
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: https://github.com/bitcoin-core/gui/issues/567 ACKs for top commit: mzumsande: Tested ACK7f90dc26c8
hebasto: ACK7f90dc26c8
jonatack: utACK7f90dc26c8
ryanofsky: Code review ACK7f90dc26c8
. Tree-SHA512: ff5095096858eae696293dc58d1cd5bd1bb60ef7c5d07d87308a0cf71c67da88cc00b301b550704625f136c4ba3a29905a934a766535a6422fe85d9662299d32
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user