mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
[test] Test that -blocksonly nodes do not send getdata(CMPCT) on a low bandwidth connection.
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
This commit is contained in:
parent
5bf6587457
commit
5e231c116b
1 changed files with 13 additions and 0 deletions
|
@ -80,5 +80,18 @@ class P2PCompactBlocksBlocksOnly(BitcoinTestFramework):
|
|||
p2p_conn_high_bw.wait_until(lambda: p2p_conn_high_bw.message_count['sendcmpct'] == 3)
|
||||
assert_equal(p2p_conn_high_bw.last_message['sendcmpct'].announce, True)
|
||||
|
||||
self.log.info("Test that -blocksonly nodes send getdata(BLOCK) instead"
|
||||
" of getdata(CMPCT) in BIP152 low bandwidth mode")
|
||||
|
||||
block1 = self.build_block_on_tip()
|
||||
|
||||
p2p_conn_blocksonly.send_message(msg_headers(headers=[CBlockHeader(block1)]))
|
||||
p2p_conn_blocksonly.sync_send_with_ping()
|
||||
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_send_with_ping()
|
||||
assert_equal(p2p_conn_high_bw.last_message['getdata'].inv, [CInv(MSG_CMPCT_BLOCK, block1.sha256)])
|
||||
|
||||
if __name__ == '__main__':
|
||||
P2PCompactBlocksBlocksOnly().main()
|
||||
|
|
Loading…
Add table
Reference in a new issue