net: Add AdvertisedVersion() for protocol version advertised to a peer

This commit is contained in:
Anthony Towns
2026-05-06 23:44:28 +10:00
parent 94ed45427c
commit 3210fc477a
4 changed files with 13 additions and 6 deletions

View File

@@ -14,7 +14,6 @@ from test_framework.p2p import (
P2PDataStore,
P2PInterface,
P2P_SERVICES,
P2P_VERSION,
start_p2p_listener,
)
from test_framework.messages import (
@@ -46,6 +45,7 @@ from test_framework.wallet import (
MiniWallet,
)
P2P_PRIVATE_VERSION = 70016
NUM_PRIVATE_BROADCAST_PER_TX = 3
@@ -195,7 +195,7 @@ class P2PPrivateBroadcast(BitcoinTestFramework):
})
dummy_address = CAddress()
dummy_address.nServices = 0
assert_equal(peer.last_message["version"].nVersion, P2P_VERSION)
assert_equal(peer.last_message["version"].nVersion, P2P_PRIVATE_VERSION)
assert_equal(peer.last_message["version"].nServices, 0)
assert_equal(peer.last_message["version"].nTime, 0)
assert_equal(peer.last_message["version"].addrTo, dummy_address)