-
Notifications
You must be signed in to change notification settings - Fork 327
options: flip listenonion to false if not listening #568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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#567
|
Another approach would be to execute |
|
Concept ACK, considering (a) the short-term goal to backport this fix into 23.0rc3, and (b) non-supportive comments on bitcoin/bitcoin#24648. |
shaavan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
- This fix addresses the issue and seems to correct it without removing a previously added feature.
- As far as I understood the problem, the issue was because the setting of
-listento 0 depended onfListen, while the setting of-listenonionto 0 depending on-listen. And both of these variables were being set at different times during the startup, leading to incorrect values for them. - This PR fixes the problem by adding the code to set listenonion to 0 if fListen is false, consequently preventing the bug due to setting the value of listen and listenonion at different times in the startup.
Let me test if this PR fixes the bug in question.
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
FWIW, bitcoin/bitcoin#15936 also fixes #567. And in long term I do prefer @ryanofsky's PR. |
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 7f90dc2
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 7f90dc2
When configuring the build of this PR, what is your output: ? |
|
Concept ACK on disabling Tor listening when listening is disabled, this would be the least surprise. I don't know enough about the forest of interacting options and Qt initialization to know if this is the clearest solution, but I think it will work. |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 7f90dc2.
Nice simple fix! Agree fixing this in the GUI is better than changing bitcoind behavior to enable listening.
I think it might be possible to write a simple unit test for this bug in https://github.com/bitcoin/bitcoin/blob/master/src/qt/test/optiontests.cpp by setting the bad listen value, initializing the options model, and then calling AppInitParameterInteraction to trigger the "Cannot set -listen=0 together with -listenonion=1" error. I think it would be good to add the unit test because it seems to me that bitcoin/bitcoin#15936 only partially fixes this bug and could cause a regression after this PR.
|
Tested ACK 7f90dc2 |
@hebasto I went out after testing this pull request, don't know how to check this and nothing can be confirmed with |
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 Github-Pull: bitcoin-core/gui#568 Rebased-From: 7f90dc2
|
Backported to 23.x in bitcoin/bitcoin#24596. |
Yeah, a package list in the guide is a bit outdated. Use https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md directly. |
… 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
70f2c57 options: flip listenonion to false if not listening (Vasil Dimov) 642f272 gui: restore Send for external signer (Sjors Provoost) 9406946 refactor: helper function signWithExternalSigner() (Sjors Provoost) fc421d4 move-only: helper function to present PSBT (Sjors Provoost) Pull request description: Backports from the GUI repo: - bitcoin-core/gui#555 - bitcoin-core/gui#568 ACKs for top commit: Sjors: utACK 70f2c57 gruve-p: ACK 70f2c57 Tree-SHA512: 883c442f8b789a9d11c949179e4382843cbb979a89a625bef3f481c7070421681d9db2af0e5b2449abca362c8ba05cf61db5893aeb6a9237b02088c2fb71e93e
|
@1440000bytes The guide didn't include some of the optional dependencies and encouraged readers to check the dependencies in |
A followup to bitcoin-core/gui#568 Co-authored-by: Jon Atack <[email protected]>
A followup to bitcoin-core#568 Co-authored-by: Jon Atack <[email protected]>
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 Github-Pull: bitcoin-core/gui#568 Rebased-From: 7f90dc26c8938f348938929b6d8bf1ea6f149209
A followup to bitcoin-core/gui#568 Co-authored-by: Jon Atack <[email protected]>
4d4dca4 test: add regression test for /issues/567 (Vasil Dimov) 3b82608 options: add a comment for -listenonion and dedup a long expression (Vasil Dimov) Pull request description: Add a test that would fail, should #567 resurface. Also, add a comment and dedup a long expression. ACKs for top commit: jarolrod: reACK 4d4dca4 jonatack: ACK 4d4dca4 hebasto: ACK 4d4dca4, tested with reverting changes from #568, and getting an expected test failure. shaavan: ACK 4d4dca4 Tree-SHA512: 59f069bdaa84586bb599e9372f89e4e66a3cafcbf58677fdf913d685c17dfa9c3d5b118829d81021a9a33b4fd8e46d4c7eb68c1dd902cf1c44a41b8e66e2967b
A followup to bitcoin-core/gui#568 Co-authored-by: Jon Atack <[email protected]>
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 Github-Pull: bitcoin-core/gui#568 Rebased-From: 7f90dc26c8938f348938929b6d8bf1ea6f149209
|
Unfortunately, the bug is not fixed on Windows. See #567 (comment). |


If the user has unchecked "Allow incoming connections" in
Settings->Options...->NetworkthenfListen=falseis saved in~/.config/Bitcoin/Bitcoin-Qt.conf. This flips-listentofalseduring startup, but leaves
-listenoniontotrue.This flipping of
-listenis done inOptionsModel::Init()afterInitParameterInteraction()has been executed which would have flipped-listenonion, should it have seen-listenbeingfalse(this is a difference between
bitcoindandbitcoin-qt).Fixes: #567