mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-07 22:28:02 +02:00
Merge bitcoin/bitcoin#34410: test: let connections happen in any order in p2p_private_broadcast.py
da7f70a532test: use port 0 for I2P addresses in p2p_private_broadcast.py (Vasil Dimov)a8ebcfd34ctest: let connections happen in any order in p2p_private_broadcast.py (Vasil Dimov)67696b207fnet: extend log message to include attempted connection type (Vasil Dimov) Pull request description: If the following two events happen: * (likely) the automatic 10 initial connections are not made to all networks * (unlikely) the network-specific logic kicks in almost immediately. It is using exponential distribution with a mean of 5 minutes (`rng.rand_exp_duration(EXTRA_NETWORK_PEER_INTERVAL)`). So if both happen, then the 11th connection may not be the expected private broadcast, but a network-specific connection. Fix this by retrieving the connection type from `destinations_factory()`. This is more flexible because it allows connections to happen in any order and does not break if e.g. the 11th connection is not the expected first private broadcast. This also makes the test run faster: before: 19-44 sec now: 10-25 sec because for example there is no need to wait for the initial 10 automatic outbound connections to be made in order to proceed. Fixes: https://github.com/bitcoin/bitcoin/issues/34387 ACKs for top commit: achow101: ACKda7f70a532andrewtoth: ACKda7f70a532mzumsande: Code Review ACKda7f70a532Tree-SHA512: 7c293e59c15c148a438e0119343b05eb278205640658c99336d4caf4848c5bae92b48e15f325fa616cbc9d5f394649abfa02406a76e802cffbd3d312a22a6885
This commit is contained in:
@@ -390,8 +390,9 @@ CNode* CConnman::ConnectNode(CAddress addrConnect,
|
||||
}
|
||||
}
|
||||
|
||||
LogDebug(BCLog::NET, "trying %s connection %s lastseen=%.1fhrs\n",
|
||||
LogDebug(BCLog::NET, "trying %s connection (%s) to %s, lastseen=%.1fhrs\n",
|
||||
use_v2transport ? "v2" : "v1",
|
||||
ConnectionTypeAsString(conn_type),
|
||||
pszDest ? pszDest : addrConnect.ToStringAddrPort(),
|
||||
Ticks<HoursDouble>(pszDest ? 0h : Now<NodeSeconds>() - addrConnect.nTime));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user