mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
doc: clarify -i2pacceptincoming help documentation
and also hoist the default setting to a constexpr and remove unused f-string operators in a related functional test.
This commit is contained in:
parent
b4fb0a3255
commit
0ed9cc5892
3 changed files with 11 additions and 12 deletions
10
doc/i2p.md
10
doc/i2p.md
|
@ -33,12 +33,10 @@ Core configuration options:
|
|||
none)
|
||||
|
||||
-i2pacceptincoming
|
||||
If set and -i2psam is also set then incoming I2P connections are
|
||||
accepted via the SAM proxy. If this is not set but -i2psam is set
|
||||
then only outgoing connections will be made to the I2P network.
|
||||
Ignored if -i2psam is not set. Listening for incoming I2P
|
||||
connections is done through the SAM proxy, not by binding to a
|
||||
local address and port (default: 1)
|
||||
Whether to accept inbound I2P connections (default: 1). Ignored if
|
||||
-i2psam is not set. Listening for inbound I2P connections is
|
||||
done through the SAM proxy, not by binding to a local address and
|
||||
port.
|
||||
```
|
||||
|
||||
In a typical situation, this suffices:
|
||||
|
|
|
@ -126,8 +126,9 @@ using node::fPruneMode;
|
|||
using node::fReindex;
|
||||
using node::nPruneTarget;
|
||||
|
||||
static const bool DEFAULT_PROXYRANDOMIZE = true;
|
||||
static const bool DEFAULT_REST_ENABLE = false;
|
||||
static constexpr bool DEFAULT_PROXYRANDOMIZE{true};
|
||||
static constexpr bool DEFAULT_REST_ENABLE{false};
|
||||
static constexpr bool DEFAULT_I2P_ACCEPT_INCOMING{true};
|
||||
|
||||
#ifdef WIN32
|
||||
// Win32 LevelDB doesn't use filedescriptors, and the ones used for
|
||||
|
@ -473,7 +474,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
|||
argsman.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target per 24h. Limit does not apply to peers with 'download' permission or blocks created within past week. 0 = no limit (default: %s). Optional suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000 base while uppercase is 1024 base", DEFAULT_MAX_UPLOAD_TARGET), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor onion services, set -noonion to disable (default: -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-i2psam=<ip:port>", "I2P SAM proxy to reach I2P peers and accept I2P connections (default: none)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-i2pacceptincoming", "If set and -i2psam is also set then incoming I2P connections are accepted via the SAM proxy. If this is not set but -i2psam is set then only outgoing connections will be made to the I2P network. Ignored if -i2psam is not set. Listening for incoming I2P connections is done through the SAM proxy, not by binding to a local address and port (default: 1)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-i2pacceptincoming", strprintf("Whether to accept inbound I2P connections (default: %i). Ignored if -i2psam is not set. Listening for inbound I2P connections is done through the SAM proxy, not by binding to a local address and port.", DEFAULT_I2P_ACCEPT_INCOMING), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-onlynet=<net>", "Make automatic outbound connections only to network <net> (" + Join(GetNetworkNames(), ", ") + "). Inbound and manual connections are not affected by this option. It can be specified multiple times to allow multiple networks.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with bloom filters (default: %u)", DEFAULT_PEERBLOOMFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-peerblockfilters", strprintf("Serve compact block filters to peers per BIP 157 (default: %u)", DEFAULT_PEERBLOCKFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
|
@ -1829,7 +1830,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
SetReachable(NET_I2P, false);
|
||||
}
|
||||
|
||||
connOptions.m_i2p_accept_incoming = args.GetBoolArg("-i2pacceptincoming", true);
|
||||
connOptions.m_i2p_accept_incoming = args.GetBoolArg("-i2pacceptincoming", DEFAULT_I2P_ACCEPT_INCOMING);
|
||||
|
||||
if (!node.connman->Start(*node.scheduler, connOptions)) {
|
||||
return false;
|
||||
|
|
|
@ -23,12 +23,12 @@ class I2PSessions(BitcoinTestFramework):
|
|||
|
||||
self.log.info("Ensure we create a persistent session when -i2pacceptincoming=1")
|
||||
node0 = self.nodes[0]
|
||||
with node0.assert_debug_log(expected_msgs=[f"Creating persistent SAM session"]):
|
||||
with node0.assert_debug_log(expected_msgs=["Creating persistent SAM session"]):
|
||||
node0.addnode(node=addr, command="onetry")
|
||||
|
||||
self.log.info("Ensure we create a transient session when -i2pacceptincoming=0")
|
||||
node1 = self.nodes[1]
|
||||
with node1.assert_debug_log(expected_msgs=[f"Creating transient SAM session"]):
|
||||
with node1.assert_debug_log(expected_msgs=["Creating transient SAM session"]):
|
||||
node1.addnode(node=addr, command="onetry")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue