forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable v2-only blanket on tor/i2p/cjdns
- Loading branch information
1 parent
0f13242
commit a602e9f
Showing
1 changed file
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1377,6 +1377,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) | |
"-cjdnsreachable is not provided")); | ||
} | ||
g_reachable_nets.Remove(NET_CJDNS); | ||
} else { | ||
g_v2_only = false; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stratospher
Author
Owner
|
||
} | ||
// Now g_reachable_nets.Contains(NET_CJDNS) is true if: | ||
// 1. -cjdnsreachable is given and | ||
|
@@ -1452,6 +1454,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) | |
|
||
if (onion_proxy.IsValid()) { | ||
SetProxy(NET_ONION, onion_proxy); | ||
g_v2_only = false; | ||
} else { | ||
// If -listenonion is set, then we will (try to) connect to the Tor control port | ||
// later from the torcontrol thread and may retrieve the onion proxy from there. | ||
|
@@ -1948,6 +1951,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) | |
return InitError(strprintf(_("Invalid -i2psam address or hostname: '%s'"), i2psam_arg)); | ||
} | ||
SetProxy(NET_I2P, Proxy{addr.value()}); | ||
g_v2_only = false; | ||
} else { | ||
if (args.IsArgSet("-onlynet") && g_reachable_nets.Contains(NET_I2P)) { | ||
return InitError( | ||
|
I meant to write a comment about this yesterday but can't find it anymore. Either I'm confused and there is a duplicate somewhere, or I forgot to press "send"...
Anyway, it might be better to either shut down with an init-error in these cases (so the user doesn't get surprised by clearnet v1 connection, this enables
g_v2_only
globally) or implement it such that we only allow v1 connections for CJDNS / Tor / I2P but still disallow them for clearnet.