Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_inv_download.py
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | def test_disconnect_fallback(self, context): | ||||
assert_equal(peer_fallback.getdata_count, 0) | assert_equal(peer_fallback.getdata_count, 0) | ||||
peer_disconnect.peer_disconnect() | peer_disconnect.peer_disconnect() | ||||
peer_disconnect.wait_for_disconnect() | peer_disconnect.wait_for_disconnect() | ||||
peer_fallback.wait_until( | peer_fallback.wait_until( | ||||
lambda: peer_fallback.getdata_count >= 1, timeout=1) | lambda: peer_fallback.getdata_count >= 1, timeout=1) | ||||
with p2p_lock: | with p2p_lock: | ||||
assert_equal(peer_fallback.getdata_count, 1) | assert_equal(peer_fallback.getdata_count, 1) | ||||
@skip(PROOF_TEST_CONTEXT) | |||||
def test_notfound_fallback(self, context): | def test_notfound_fallback(self, context): | ||||
self.log.info( | self.log.info( | ||||
'Check that notfounds will select another peer for download immediately') | 'Check that notfounds will select another peer for download immediately') | ||||
peer1 = self.nodes[0].add_p2p_connection(context.p2p_conn()) | peer1 = self.nodes[0].add_p2p_connection(context.p2p_conn()) | ||||
peer2 = self.nodes[0].add_p2p_connection(context.p2p_conn()) | peer2 = self.nodes[0].add_p2p_connection(context.p2p_conn()) | ||||
for p in [peer1, peer2]: | for p in [peer1, peer2]: | ||||
p.send_message(msg_inv([CInv(t=context.inv_type, h=0xffdd)])) | p.send_message(msg_inv([CInv(t=context.inv_type, h=0xffdd)])) | ||||
# One of the peers is asked for the data | # One of the peers is asked for the data | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |