aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_addr_relay.py
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-09-19 14:11:09 +0200
committerJon Atack <jon@atack.com>2021-09-19 14:20:48 +0200
commitb69a106bcd8ddefdb810df6ebb3625c430197e04 (patch)
treec24d087588d9905e1a14ce769326b916019cf3c3 /test/functional/p2p_addr_relay.py
parentde2af19dc8e8c848afbc4b43b9b4092fe263364f (diff)
downloadbitcoin-b69a106bcd8ddefdb810df6ebb3625c430197e04.tar.xz
test: use test_framework.p2p P2P_SERVICES in functional tests
Diffstat (limited to 'test/functional/p2p_addr_relay.py')
-rwxr-xr-xtest/functional/p2p_addr_relay.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/p2p_addr_relay.py b/test/functional/p2p_addr_relay.py
index e93698b08e..15b90fa61f 100755
--- a/test/functional/p2p_addr_relay.py
+++ b/test/functional/p2p_addr_relay.py
@@ -6,22 +6,22 @@
Test addr relay
"""
+import random
+import time
+
from test_framework.messages import (
CAddress,
- NODE_NETWORK,
- NODE_WITNESS,
msg_addr,
msg_getaddr,
- msg_verack
+ msg_verack,
)
from test_framework.p2p import (
P2PInterface,
p2p_lock,
+ P2P_SERVICES,
)
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_greater_than
-import random
-import time
class AddrReceiver(P2PInterface):
@@ -96,7 +96,7 @@ class AddrTest(BitcoinTestFramework):
for i in range(num):
addr = CAddress()
addr.time = self.mocktime + i
- addr.nServices = NODE_NETWORK | NODE_WITNESS
+ addr.nServices = P2P_SERVICES
addr.ip = f"123.123.123.{self.counter % 256}"
addr.port = 8333 + i
addrs.append(addr)
@@ -111,7 +111,7 @@ class AddrTest(BitcoinTestFramework):
for i in range(num):
addr = CAddress()
addr.time = self.mocktime + i
- addr.nServices = NODE_NETWORK | NODE_WITNESS
+ addr.nServices = P2P_SERVICES
addr.ip = f"{random.randrange(128,169)}.{random.randrange(1,255)}.{random.randrange(1,255)}.{random.randrange(1,255)}"
addr.port = 8333
addrs.append(addr)