Skip to content

Commit

Permalink
net: enable v2transport by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa authored and lateminer committed May 15, 2024
1 parent 079e2b0 commit 77210e4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ 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};
static constexpr bool DEFAULT_V2_TRANSPORT{true};

typedef int64_t NodeId;

Expand Down
15 changes: 15 additions & 0 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ def __init__(self, i, datadir_path, *, chain, rpchost, timewait, timeout_factor,
if self.version_is_at_least(239000):
self.args.append("-loglevel=trace")

# Default behavior from global -v2transport flag is added to args to persist it over restarts.
# May be overwritten in individual tests, using extra_args.
self.default_to_v2 = v2transport
if self.version_is_at_least(260000):
# 26.0 and later support v2transport
if v2transport:
self.args.append("-v2transport=1")
else:
self.args.append("-v2transport=0")
else:
# v2transport requested but not supported for node
assert not v2transport

self.cli = TestNodeCLI(bitcoin_cli, self.datadir_path)
self.use_cli = use_cli
self.start_perf = start_perf
Expand Down Expand Up @@ -198,6 +211,8 @@ def start(self, extra_args=None, *, cwd=None, stdout=None, stderr=None, env=None
if extra_args is None:
extra_args = self.extra_args

self.use_v2transport = "-v2transport=1" in extra_args or (self.default_to_v2 and "-v2transport=0" not in extra_args)

# Add a new stdout and stderr file each time blackmored is started
if stderr is None:
stderr = tempfile.NamedTemporaryFile(dir=self.stderr_dir, delete=False)
Expand Down

0 comments on commit 77210e4

Please sign in to comment.