mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
net: advertise NODE_P2P_V2 if CLI arg -v2transport is on
Co-authored-by: Dhruv Mehta <856960+dhruv@users.noreply.github.com>
This commit is contained in:
parent
e7b0004b37
commit
abf343b320
6 changed files with 14 additions and 0 deletions
|
@ -498,6 +498,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
|||
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", 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("-v2transport", strprintf("Support v2 transport (default: %u)", DEFAULT_V2_TRANSPORT), 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);
|
||||
argsman.AddArg("-txreconciliation", strprintf("Enable transaction reconciliations per BIP 330 (default: %d)", DEFAULT_TXRECONCILIATION_ENABLE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CONNECTION);
|
||||
|
@ -893,6 +894,11 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
|||
}
|
||||
}
|
||||
|
||||
// Signal NODE_P2P_V2 if BIP324 v2 transport is enabled.
|
||||
if (args.GetBoolArg("-v2transport", DEFAULT_V2_TRANSPORT)) {
|
||||
nLocalServices = ServiceFlags(nLocalServices | NODE_P2P_V2);
|
||||
}
|
||||
|
||||
// Signal NODE_COMPACT_FILTERS if peerblockfilters and basic filters index are both enabled.
|
||||
if (args.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS)) {
|
||||
if (g_enabled_filter_types.count(BlockFilterType::BASIC) != 1) {
|
||||
|
|
|
@ -94,6 +94,8 @@ static constexpr bool DEFAULT_FIXEDSEEDS{true};
|
|||
static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
|
||||
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;
|
||||
|
||||
static constexpr bool DEFAULT_V2_TRANSPORT{false};
|
||||
|
||||
typedef int64_t NodeId;
|
||||
|
||||
struct AddedNodeInfo
|
||||
|
|
|
@ -199,6 +199,7 @@ static std::string serviceFlagToStr(size_t bit)
|
|||
case NODE_WITNESS: return "WITNESS";
|
||||
case NODE_COMPACT_FILTERS: return "COMPACT_FILTERS";
|
||||
case NODE_NETWORK_LIMITED: return "NETWORK_LIMITED";
|
||||
case NODE_P2P_V2: return "P2P_V2";
|
||||
// Not using default, so we get warned when a case is missing
|
||||
}
|
||||
|
||||
|
|
|
@ -291,6 +291,9 @@ enum ServiceFlags : uint64_t {
|
|||
// See BIP159 for details on how this is implemented.
|
||||
NODE_NETWORK_LIMITED = (1 << 10),
|
||||
|
||||
// NODE_P2P_V2 means the node supports BIP324 transport
|
||||
NODE_P2P_V2 = (1 << 11),
|
||||
|
||||
// Bits 24-31 are reserved for temporary experiments. Just pick a bit that
|
||||
// isn't getting used, or one not being used much, and notify the
|
||||
// bitcoin-development mailing list. Remember that service bits are just
|
||||
|
|
|
@ -65,6 +65,7 @@ constexpr ServiceFlags ALL_SERVICE_FLAGS[]{
|
|||
NODE_WITNESS,
|
||||
NODE_COMPACT_FILTERS,
|
||||
NODE_NETWORK_LIMITED,
|
||||
NODE_P2P_V2,
|
||||
};
|
||||
|
||||
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]{
|
||||
|
|
|
@ -52,6 +52,7 @@ NODE_BLOOM = (1 << 2)
|
|||
NODE_WITNESS = (1 << 3)
|
||||
NODE_COMPACT_FILTERS = (1 << 6)
|
||||
NODE_NETWORK_LIMITED = (1 << 10)
|
||||
NODE_P2P_V2 = (1 << 11)
|
||||
|
||||
MSG_TX = 1
|
||||
MSG_BLOCK = 2
|
||||
|
|
Loading…
Add table
Reference in a new issue