gui icon indicating copy to clipboard operation
gui copied to clipboard

Unable to open bitcoin-qt when incoming connections disabled in settings

Open ghost opened this issue 3 years ago • 11 comments

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

image

image

To reproduce

  1. Download v22.0, run and disable incoming connections in settings
  2. Restart bitcoin-qt
  3. Download RC2, run and look for errors when incoming connections are disabled

System information

Confirmed the issue on Ubuntu and Windows

ghost avatar Mar 22 '22 15:03 ghost

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

hebasto avatar Mar 22 '22 17:03 hebasto

The behavior was changed in bitcoin/bitcoin#20769.

hebasto avatar Mar 22 '22 17:03 hebasto

@1440000bytes

Thank you for testing v23.0rc2!

~As this issue describes the expected behavior, could it be closed now?~

hebasto avatar Mar 22 '22 17:03 hebasto

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

ghost avatar Mar 22 '22 18:03 ghost

@1440000bytes

Yes, new behavior looks contra-intuitive.

hebasto avatar Mar 22 '22 18:03 hebasto

@1440000bytes

As a temporary workaround suggesting to run bitcoin-qt -resetguisettings.

hebasto avatar Mar 22 '22 18:03 hebasto

@1440000bytes

Do you mind testing ~bitcoin/bitcoin#24648~ #568?

hebasto avatar Mar 23 '22 08:03 hebasto

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 with Error: 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) is true (!?), so listenonion's default value is not flipped from true to false
  • When AppInitParameterInteraction() executes, args.GetBoolArg("-listen", DEFAULT_LISTEN) is false and listenonion is still with its default value (true), untouched by the user. Thus the error due to the incompatible options.

vasild avatar Mar 23 '22 09:03 vasild

Apparently, the bug still persist on Windows. Tested v26.1rc1:

image_2024-02-24_16-52-57

UPD. ... And on Linux (a regression?).

hebasto avatar Feb 24 '24 16:02 hebasto

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.

ryanofsky avatar Feb 24 '24 23:02 ryanofsky

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.

vasild avatar Feb 26 '24 16:02 vasild