public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "Anton Shevchenko" <anton@sancoder•com>
To: "Bitcoin Devs" <bitcoin-dev@lists•linuxfoundation.org>
Subject: [bitcoin-dev] bitcoind -proxy=host:port doesn't work for unroutable network
Date: Fri, 22 Jul 2022 22:08:55 -0700	[thread overview]
Message-ID: <3d864872-bc5c-40b0-9eab-2b38add2aa55@www.fastmail.com> (raw)

Hello,

Got unexpected behavior when trying to run bitcoind with -proxy setting.
-proxy is used to connect to SOCKS5 proxy which is able to access some internal network.
bitcoind is started with -noconnect option and network activity is absent (as it should be).

Then I command bitcoin-cli to connect to node with address 10.x.y.z with the command
bitcoin-cli addnode 10.x.y.z add

Expected behavior is for bitcoind to initiate connection through proxy.
Actual behavior is bitcoind trying to connect without using proxy.

In the code:
CConnman::ConnectNode calls GetProxy and GetProxy returns false because CNetAddr::GetNetwork returns NET_UNROUTABLE.

My take is this is unexpected behavior at minimum and should be documented.
Better way is to introduce another option just for the unroutable addresses:
- connect locally (for compatibility reasons, default);
- connect thru proxy;
- don't connect to unroutable addresses.


--  Anton Shevchenko


             reply	other threads:[~2022-07-23  5:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23  5:08 Anton Shevchenko [this message]
2022-07-23 13:00 ` Anton Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d864872-bc5c-40b0-9eab-2b38add2aa55@www.fastmail.com \
    --to=anton@sancoder$(echo .)com \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox