Skip to content

Commit

Permalink
fix: relayed addresses should use mocktime
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Apr 2, 2024
1 parent 2a44f2e commit acbbe8c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/functional/p2p_addr_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
from test_framework.util import (
assert_equal,
)
import time

ADDRS = []
for i in range(10):
addr = CAddress()
addr.time = int(time.time()) + i
addr.nServices = NODE_NETWORK
addr.ip = "123.123.123.{}".format(i % 256)
addr.port = 8333 + i
ADDRS.append(addr)


class AddrReceiver(P2PInterface):
def on_addr(self, message):
Expand All @@ -41,6 +30,15 @@ def set_test_params(self):
self.num_nodes = 1

def run_test(self):
ADDRS = []
for i in range(10):
addr = CAddress()
addr.time = int(self.mocktime) + i
addr.nServices = NODE_NETWORK
addr.ip = "123.123.123.{}".format(i % 256)
addr.port = 8333 + i
ADDRS.append(addr)

self.log.info('Create connection that sends addr messages')
addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
msg = msg_addr()
Expand Down

0 comments on commit acbbe8c

Please sign in to comment.