gui
gui copied to clipboard
Unable to open bitcoin-qt when incoming connections disabled in settings
bitcoin-qt throws an error and crashes if incoming connections are disabled in settings. This did not happen in v22.0 but noticed it in RC2 during testing.
Expected behavior
~~Disable listenonion and launch bitcoin-qt automatically.~~ No error and bitcoin-qt should start as it happens with v22.0
Actual behavior


To reproduce
- Download v22.0, run and disable incoming connections in settings
- Restart bitcoin-qt
- Download RC2, run and look for errors when incoming connections are disabled
System information
Confirmed the issue on Ubuntu and Windows
Isn't an error message self-descriptive?
FWIW, the behavior is not GUI-specific:
$ ./bin/bitcoind -listen=0 -listenonion=1
Error: Cannot set -listen=0 together with -listenonion=1
The behavior was changed in bitcoin/bitcoin#20769.
@1440000bytes
Thank you for testing v23.0rc2!
~As this issue describes the expected behavior, could it be closed now?~
Isn't an error message self-descriptive?
It is, although there was a change in behavior compared to last release and not all gui users know usage of command line parameters.
FWIW, the behavior is not GUI-specific:
I am running bitcoin-qt binary with nothing in config, no command line parameters and incoming connections unchecked in settings.
The behavior was changed in https://github.com/bitcoin/bitcoin/pull/20769.
According to pull request it should enforce listenonion=0 when the listen is 0. Error says listenionion is 1.
@1440000bytes
Thank you for testing v23.0rc2!
As this issue describes the expected behavior, could it be closed now?
Expected behavior is no error and bitcoin-qt should start as it happens with v22.0
@1440000bytes
Yes, new behavior looks contra-intuitive.
@1440000bytes
As a temporary workaround suggesting to run bitcoin-qt -resetguisettings.
@1440000bytes
Do you mind testing ~bitcoin/bitcoin#24648~ #568?
To reproduce:
- start
bitcoin-qt, go to settings -> network and remove the checkbox from "Allow incoming connections" - shut down
- start
bitcoin-qt- it refuses to start withError: Cannot set -listen=0 together with -listenonion=1
That "Allow incoming connections" setting is saved in ~/.config/Bitcoin/Bitcoin-Qt.conf under fListen=false.
The problem is that during bitcoin-qt startup, when fListen=false in ~/.config/Bitcoin/Bitcoin-Qt.conf, then:
- When
InitParameterInteraction()executes,args.GetBoolArg("-listen", DEFAULT_LISTEN)istrue(!?), solistenonion's default value is not flipped fromtruetofalse - When
AppInitParameterInteraction()executes,args.GetBoolArg("-listen", DEFAULT_LISTEN)isfalseandlistenonionis still with its default value (true), untouched by the user. Thus the error due to the incompatible options.
Apparently, the bug still persist on Windows. Tested v26.1rc1:
UPD. ... And on Linux (a regression?).
Not sure what is causing this, but it looks like the original fix for this:
- 7f90dc26c8938f348938929b6d8bf1ea6f149209 from #568
was removed in:
- a09e3b7cf29c3b1fd320badbed32275e0aa83cda from #602
and replaced with a new fix:
https://github.com/bitcoin-core/gui/blob/1ac627c485a43e50a9a49baddce186ee3ad4daad/src/qt/optionsmodel.cpp#L803-L808
I'm not sure why this is not working now, but I think I'd suggest opening a new bug with current steps to reproduce.
Opened https://github.com/bitcoin/bitcoin/issues/29482 to track https://github.com/bitcoin-core/gui/issues/567#issuecomment-1962422185 which I believe is a different issue than the current one.