aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_maxuploadtarget.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-03 02:12:39 +0800
committerMarcoFalke <falke.marco@gmail.com>2020-04-03 02:12:46 +0800
commitff53433fe4ed06893d7c497a9687f326b0280d4e (patch)
tree9279a763b6ea317d05b8db35a535f5e5acbf5fbb /test/functional/feature_maxuploadtarget.py
parentb83565625e32b22395e28c1965b2e42fc17f04d7 (diff)
parent6112a209828c43930f677c45461339cdf68a56e9 (diff)
downloadbitcoin-ff53433fe4ed06893d7c497a9687f326b0280d4e.tar.xz
Merge #18494: test: replace (send_message + sync_with_ping) with send_and_ping
6112a209828c43930f677c45461339cdf68a56e9 test: replace (send_message + sync_with_ping) with send_and_ping (Jon Atack) Pull request description: This is a follow-up to faf1d047313e71658fb31f6b94fdd5d37705ab85 yesterday. ACKs for top commit: vasild: utACK 6112a20 MarcoFalke: ACK 6112a209828c43930f677c45461339cdf68a56e9 🎞 Tree-SHA512: 749644ac9a1ef0e1aa6c3ac5e899eb3fa7fb9c0909352f922a80412df2bc0e539692a7757af550eff4d4914cbe57b0c75ce3948f569acc7a52852e91a55ad457
Diffstat (limited to 'test/functional/feature_maxuploadtarget.py')
-rwxr-xr-xtest/functional/feature_maxuploadtarget.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py
index 974388d798..dc00e03fe7 100755
--- a/test/functional/feature_maxuploadtarget.py
+++ b/test/functional/feature_maxuploadtarget.py
@@ -94,8 +94,7 @@ class MaxUploadTest(BitcoinTestFramework):
# 576MB will be reserved for relaying new blocks, so expect this to
# succeed for ~235 tries.
for i in range(success_count):
- p2p_conns[0].send_message(getdata_request)
- p2p_conns[0].sync_with_ping()
+ p2p_conns[0].send_and_ping(getdata_request)
assert_equal(p2p_conns[0].block_receive_map[big_old_block], i+1)
assert_equal(len(self.nodes[0].getpeerinfo()), 3)
@@ -112,8 +111,7 @@ class MaxUploadTest(BitcoinTestFramework):
# We'll try 800 times
getdata_request.inv = [CInv(2, big_new_block)]
for i in range(800):
- p2p_conns[1].send_message(getdata_request)
- p2p_conns[1].sync_with_ping()
+ p2p_conns[1].send_and_ping(getdata_request)
assert_equal(p2p_conns[1].block_receive_map[big_new_block], i+1)
self.log.info("Peer 1 able to repeatedly download new block")
@@ -132,8 +130,7 @@ class MaxUploadTest(BitcoinTestFramework):
# and p2p_conns[2] should be able to retrieve the old block.
self.nodes[0].setmocktime(int(time.time()))
p2p_conns[2].sync_with_ping()
- p2p_conns[2].send_message(getdata_request)
- p2p_conns[2].sync_with_ping()
+ p2p_conns[2].send_and_ping(getdata_request)
assert_equal(p2p_conns[2].block_receive_map[big_old_block], 1)
self.log.info("Peer 2 able to download old block")
@@ -150,8 +147,7 @@ class MaxUploadTest(BitcoinTestFramework):
#retrieve 20 blocks which should be enough to break the 1MB limit
getdata_request.inv = [CInv(2, big_new_block)]
for i in range(20):
- self.nodes[0].p2p.send_message(getdata_request)
- self.nodes[0].p2p.sync_with_ping()
+ self.nodes[0].p2p.send_and_ping(getdata_request)
assert_equal(self.nodes[0].p2p.block_receive_map[big_new_block], i+1)
getdata_request.inv = [CInv(2, big_old_block)]