Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_maxuploadtarget.py
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# succeed for ~70 tries. | # succeed for ~70 tries. | ||||
for i in range(success_count): | for i in range(success_count): | ||||
p2p_conns[0].send_and_ping(getdata_request) | p2p_conns[0].send_and_ping(getdata_request) | ||||
assert_equal(p2p_conns[0].block_receive_map[big_old_block], i + 1) | assert_equal(p2p_conns[0].block_receive_map[big_old_block], i + 1) | ||||
assert_equal(len(self.nodes[0].getpeerinfo()), 3) | assert_equal(len(self.nodes[0].getpeerinfo()), 3) | ||||
# At most a couple more tries should succeed (depending on how long | # At most a couple more tries should succeed (depending on how long | ||||
# the test has been running so far). | # the test has been running so far). | ||||
for i in range(3): | for _ in range(3): | ||||
p2p_conns[0].send_message(getdata_request) | p2p_conns[0].send_message(getdata_request) | ||||
p2p_conns[0].wait_for_disconnect() | p2p_conns[0].wait_for_disconnect() | ||||
assert_equal(len(self.nodes[0].getpeerinfo()), 2) | assert_equal(len(self.nodes[0].getpeerinfo()), 2) | ||||
self.log.info( | self.log.info( | ||||
"Peer 0 disconnected after downloading old block too many times") | "Peer 0 disconnected after downloading old block too many times") | ||||
# Requesting the current block on p2p_conns[1] should succeed indefinitely, | # Requesting the current block on p2p_conns[1] should succeed indefinitely, | ||||
# even when over the max upload target. | # even when over the max upload target. | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |