Skip to content
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

Advertised address where nobody is listening #20657

Closed
Rspigler opened this issue Dec 15, 2020 · 3 comments
Closed

Advertised address where nobody is listening #20657

Rspigler opened this issue Dec 15, 2020 · 3 comments
Labels

Comments

@Rspigler
Copy link
Contributor

Rspigler commented Dec 15, 2020

Bug reported by @vasild here: (bitcoin-core/gui#86 (comment))

listen=0 will cause us not to listen on any port, so we would not accept any incoming connections, regardless of whether clearnet or Tor.

$ bitcoind
...
2020-10-28T08:41:57Z Config file arg: listen="0"
2020-10-28T08:41:57Z Config file arg: listenonion="1"
2020-10-28T08:41:57Z Config file arg: rpcport="8332"
...
2020-10-28T08:42:19Z tor: Got service ID foo, advertising service foo.onion:8333
2020-10-28T08:42:19Z AddLocal(foo.onion:8333,4)

$ netstat
tcp4 0 0 127.0.0.1.8332 . LISTEN
(bitcoind is only listening on the RPC port)

I guess this can be considered as a bug because it will (I guess) advertise foo.onion:8333 where nobody is listening.

@Rspigler Rspigler added the Bug label Dec 15, 2020
@vasild
Copy link
Contributor

vasild commented Dec 15, 2020

Should we automatically set listenonion to 0 if listen is set to 0?

jadijadi pushed a commit to jadijadi/bitcoin that referenced this issue Dec 26, 2020
…ning

If we provide listen=0 and listenonion=1 at the same time, the system will advertises
its onion address while nothing is listening for it.

With this change, the system will change the listenonion to 0 in above situation and
will inform the user in the logs.
jadijadi pushed a commit to jadijadi/bitcoin that referenced this issue Dec 26, 2020
If the bitcoind starts when listen=0 but listenonion=1, the daemon will
advertise its onion address but nothing is listening for it.

This update will enforce listenonion=0 when the listen is 0.
@jadijadi
Copy link
Contributor

Hi guys, Sent this PR for this: #20769

jadijadi pushed a commit to jadijadi/bitcoin that referenced this issue Dec 27, 2020
If the bitcoind starts when listen=0 but listenonion=1, the daemon will
advertise its onion address but nothing is listening for it.

This update will enforce listenonion=0 when the listen is 0.
@Rspigler
Copy link
Contributor Author

Makes sense to me, as this was the assumed behavior

jadijadi pushed a commit to jadijadi/bitcoin that referenced this issue Jan 2, 2021
If the bitcoind starts when listen=0 but listenonion=1, the daemon will
advertise its onion address but nothing is listening for it.

This update will enforce listenonion=0 when the listen is 0.
maflcko pushed a commit to maflcko/bitcoin-core that referenced this issue Aug 23, 2021
…ere nobody is listening

a381374 net: do not advertise address where nobody is listening (Jadi)

Pull request description:

  If the bitcoind starts when listen=0 but listenonion=1, the daemon will
  advertise its onion address but nothing is listening for it.

  This update will enforce listenonion=0 when the listen is 0.

ACKs for top commit:
  vasild:
    ACK a381374
  jarolrod:
    ACK a381374
  amitiuttarwar:
    ACK a381374

Tree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
sidhujag pushed a commit to syscoin/syscoin that referenced this issue Aug 23, 2021
…ere nobody is listening

a381374 net: do not advertise address where nobody is listening (Jadi)

Pull request description:

  If the bitcoind starts when listen=0 but listenonion=1, the daemon will
  advertise its onion address but nothing is listening for it.

  This update will enforce listenonion=0 when the listen is 0.

ACKs for top commit:
  vasild:
    ACK a381374
  jarolrod:
    ACK a381374
  amitiuttarwar:
    ACK a381374

Tree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@vasild @jadijadi @Rspigler and others