test: Prefer send_and_ping over send_message+sync_with_ping
Also, add an explanation for the preference in the docs.
This commit is contained in:
3 files changed
+14
-16
No files matched your search
@@ -93,19 +93,16 @@ class P2PCompactBlocksBlocksOnly(BitcoinTestFramework):
|
||||
|
||||
block1 = self.build_block_on_tip()
|
||||
|
||||
p2p_conn_blocksonly.send_message(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
p2p_conn_blocksonly.sync_with_ping()
|
||||
p2p_conn_blocksonly.send_and_ping(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
assert_equal(p2p_conn_blocksonly.last_message['getdata'].inv, [CInv(MSG_BLOCK | MSG_WITNESS_FLAG, block1.sha256)])
|
||||
|
||||
p2p_conn_high_bw.send_message(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
p2p_conn_high_bw.sync_with_ping()
|
||||
p2p_conn_high_bw.send_and_ping(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
assert_equal(p2p_conn_high_bw.last_message['getdata'].inv, [CInv(MSG_CMPCT_BLOCK, block1.sha256)])
|
||||
|
||||
self.log.info("Test that getdata(CMPCT) is still sent on BIP152 low bandwidth connections"
|
||||
" when no -blocksonly nodes are involved")
|
||||
|
||||
p2p_conn_low_bw.send_and_ping(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
p2p_conn_low_bw.sync_with_ping()
|
||||
assert_equal(p2p_conn_low_bw.last_message['getdata'].inv, [CInv(MSG_CMPCT_BLOCK, block1.sha256)])
|
||||
|
||||
self.log.info("Test that -blocksonly nodes still serve compact blocks")
|
||||
|
||||
Reference in new issue
Block a user