Why Nostr? What is Njump?
2023-06-07 23:12:07
in reply to

Anton Shevchenko [ARCHIVE] on Nostr: 📅 Original date posted:2022-07-23 📝 Original message:Hello, Got unexpected ...

📅 Original date posted:2022-07-23
📝 Original message: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
Author Public Key
npub1s30u622v6qh9zh88pmnr8ahv5cdxh6slu3rhqh57vzsrs8h8qehq0fs7ae