Returning Enable listening to its saved value can disable listening after restart #1089

Open
opened 2026-11-09 00:54:42 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-09 00:54:42 +00:00 (Migrated from github.com)

Returning Enable listening to its saved on value can delete the setting that made it effective. The switch remains on for the current session, but the next restart turns listening off.

To reproduce:

  1. Use a regtest profile with onboarding completed and no explicit listen setting. Start with -connect=0 -networkactive=0 -natpmp=0 -discover=0 -listenonion=0.
  2. Open Settings → Connection. Enable listening is initially off. Turn it on and restart with the same arguments.
  3. Confirm that the switch is on and the configured TCP listening port is open. settings.json contains "listen": true.
  4. Turn Enable listening off, wait for the change to finish, then turn it back on.
  5. Restart again without changing the configuration.

Turning the switch off writes "listen": false. Turning it back on removes the key entirely, although the switch displays on. After restart, the switch is off and the TCP listening port is closed. Core logs:

parameter interaction: -connect or -maxconnections=0 set -> setting -listen=0

The first restart demonstrates that explicit listening works with this configuration. The off/on round trip should restore that same saved choice and preserve it across the next restart.

The problem is in QML’s settings persistence. GuiOverrideValue() removes true because it equals DEFAULT_LISTEN. However, without the explicit override, the next startup applies the different default implied by connect=0. Core is following the configuration it receives.

Related to #588 and #883. The explicit-listen preservation in #883 applies during onboarding; its current runtime override helper retains this erasure path.

Observed on merged qt6 at 6e54a48ab571, macOS / Qt 6.9, using the full application with isolated offscreen regtest fixtures. Saved settings, Core’s startup log and the actual TCP port agree. Networking remained disabled with zero peers; the port check used localhost. This report is limited to the reproduced listening transition.

Returning Enable listening to its saved on value can delete the setting that made it effective. The switch remains on for the current session, but the next restart turns listening off. To reproduce: 1. Use a regtest profile with onboarding completed and no explicit `listen` setting. Start with `-connect=0 -networkactive=0 -natpmp=0 -discover=0 -listenonion=0`. 2. Open Settings → Connection. Enable listening is initially off. Turn it on and restart with the same arguments. 3. Confirm that the switch is on and the configured TCP listening port is open. `settings.json` contains `"listen": true`. 4. Turn Enable listening off, wait for the change to finish, then turn it back on. 5. Restart again without changing the configuration. Turning the switch off writes `"listen": false`. Turning it back on removes the key entirely, although the switch displays on. After restart, the switch is off and the TCP listening port is closed. Core logs: ```text parameter interaction: -connect or -maxconnections=0 set -> setting -listen=0 ``` The first restart demonstrates that explicit listening works with this configuration. The off/on round trip should restore that same saved choice and preserve it across the next restart. The problem is in QML’s settings persistence. [`GuiOverrideValue()`](https://github.com/bitcoin-core/gui-qml/blob/6e54a48ab571cb46b813eb1d98a301401089192f/qml/core_settings.cpp#L574) removes `true` because it equals `DEFAULT_LISTEN`. However, without the explicit override, the next startup applies the different default implied by `connect=0`. Core is following the configuration it receives. Related to [#588](https://github.com/bitcoin-core/gui-qml/issues/588) and [#883](https://github.com/bitcoin-core/gui-qml/pull/883). The explicit-listen preservation in #883 applies during onboarding; its current [runtime override helper](https://github.com/bitcoin-core/gui-qml/blob/8e5b4d1f090a32379bb22181bb5c56bba3c7afc2/qml/core_settings.cpp#L574) retains this erasure path. Observed on merged `qt6` at `6e54a48ab571`, macOS / Qt 6.9, using the full application with isolated offscreen regtest fixtures. Saved settings, Core’s startup log and the actual TCP port agree. Networking remained disabled with zero peers; the port check used localhost. This report is limited to the reproduced listening transition.
Sign in to join this conversation.
No description provided.