MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / P2PIgnoreInv

Class P2PIgnoreInv

test/functional/p2p_node_network_limited.py:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14from test_framework.util import assert_equal, disconnect_nodes, connect_nodes_bi, sync_blocks, wait_until
15
16class P2PIgnoreInv(P2PInterface):
17 firstAddrnServices = 0
18 def on_inv(self, message):
19 # The node will send us invs for other blocks. Ignore them.
20 pass
21 def on_addr(self, message):
22 self.firstAddrnServices = message.addrs[0].nServices
23 def wait_for_addr(self, timeout=5):
24 test_function = lambda: self.last_message.get("addr")
25 wait_until(test_function, timeout=timeout, lock=mininode_lock)
26 def send_getdata_for_block(self, blockhash):
27 getdata_request = msg_getdata()
28 getdata_request.inv.append(CInv(2, int(blockhash, 16)))
29 self.send_message(getdata_request)
30
31class NodeNetworkLimitedTest(BitcoinTestFramework):
32 def set_test_params(self):

Callers 1

run_testMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected