@@ -113,12 +113,12 @@ def get_headers(self, locator, hashstop):
113
113
msg = msg_getheaders ()
114
114
msg .locator .vHave = locator
115
115
msg .hashstop = hashstop
116
- self .send_message (msg )
116
+ self .send_without_ping (msg )
117
117
118
118
def send_header_for_blocks (self , new_blocks ):
119
119
headers_message = msg_headers ()
120
120
headers_message .headers = [CBlockHeader (b ) for b in new_blocks ]
121
- self .send_message (headers_message )
121
+ self .send_without_ping (headers_message )
122
122
123
123
def request_headers_and_sync (self , locator , hashstop = 0 ):
124
124
self .clear_block_announcement ()
@@ -138,7 +138,7 @@ def send_await_disconnect(self, message, timeout=30):
138
138
139
139
This is used when we want to send a message into the node that we expect
140
140
will get us disconnected, eg an invalid block."""
141
- self .send_message (message )
141
+ self .send_without_ping (message )
142
142
self .wait_for_disconnect (timeout = timeout )
143
143
144
144
class CompactBlocksTest (BitcoinTestFramework ):
@@ -325,7 +325,7 @@ def test_compactblock_construction(self, test_node):
325
325
# Now fetch the compact block using a normal non-announce getdata
326
326
test_node .clear_block_announcement ()
327
327
inv = CInv (MSG_CMPCT_BLOCK , block_hash )
328
- test_node .send_message (msg_getdata ([inv ]))
328
+ test_node .send_without_ping (msg_getdata ([inv ]))
329
329
330
330
test_node .wait_until (lambda : "cmpctblock" in test_node .last_message , timeout = 30 )
331
331
@@ -386,7 +386,7 @@ def test_compactblock_requests(self, test_node):
386
386
block = self .build_block_on_tip (node )
387
387
388
388
if announce == "inv" :
389
- test_node .send_message (msg_inv ([CInv (MSG_BLOCK , block .sha256 )]))
389
+ test_node .send_without_ping (msg_inv ([CInv (MSG_BLOCK , block .sha256 )]))
390
390
test_node .wait_for_getheaders (timeout = 30 )
391
391
test_node .send_header_for_blocks ([block ])
392
392
else :
@@ -497,7 +497,7 @@ def test_tip_after_message(node, peer, msg, tip):
497
497
block = self .build_block_with_transactions (node , utxo , 10 )
498
498
self .utxos .append ([block .vtx [- 1 ].sha256 , 0 , block .vtx [- 1 ].vout [0 ].nValue ])
499
499
for tx in block .vtx [1 :]:
500
- test_node .send_message (msg_tx (tx ))
500
+ test_node .send_without_ping (msg_tx (tx ))
501
501
test_node .sync_with_ping ()
502
502
# Make sure all transactions were accepted.
503
503
mempool = node .getrawmempool ()
@@ -525,7 +525,7 @@ def test_incorrect_blocktxn_response(self, test_node):
525
525
self .utxos .append ([block .vtx [- 1 ].sha256 , 0 , block .vtx [- 1 ].vout [0 ].nValue ])
526
526
# Relay the first 5 transactions from the block in advance
527
527
for tx in block .vtx [1 :6 ]:
528
- test_node .send_message (msg_tx (tx ))
528
+ test_node .send_without_ping (msg_tx (tx ))
529
529
test_node .sync_with_ping ()
530
530
# Make sure all transactions were accepted.
531
531
mempool = node .getrawmempool ()
@@ -581,7 +581,7 @@ def test_getblocktxn_handler(self, test_node):
581
581
msg .block_txn_request = BlockTransactionsRequest (int (block_hash , 16 ), [])
582
582
num_to_request = random .randint (1 , len (block .vtx ))
583
583
msg .block_txn_request .from_absolute (sorted (random .sample (range (len (block .vtx )), num_to_request )))
584
- test_node .send_message (msg )
584
+ test_node .send_without_ping (msg )
585
585
test_node .wait_until (lambda : "blocktxn" in test_node .last_message , timeout = 10 )
586
586
587
587
[tx .calc_sha256 () for tx in block .vtx ]
@@ -616,7 +616,7 @@ def test_getblocktxn_handler(self, test_node):
616
616
block = from_hex (CBlock (), node .getblock (block_hash , False ))
617
617
msg .block_txn_request = BlockTransactionsRequest (int (block_hash , 16 ), [len (block .vtx )])
618
618
with node .assert_debug_log (['getblocktxn with out-of-bounds tx indices' ]):
619
- bad_peer .send_message (msg )
619
+ bad_peer .send_without_ping (msg )
620
620
bad_peer .wait_for_disconnect ()
621
621
622
622
def test_low_work_compactblocks (self , test_node ):
@@ -651,7 +651,7 @@ def test_compactblocks_not_at_tip(self, test_node):
651
651
test_node .wait_until (test_node .received_block_announcement , timeout = 30 )
652
652
653
653
test_node .clear_block_announcement ()
654
- test_node .send_message (msg_getdata ([CInv (MSG_CMPCT_BLOCK , int (new_blocks [0 ], 16 ))]))
654
+ test_node .send_without_ping (msg_getdata ([CInv (MSG_CMPCT_BLOCK , int (new_blocks [0 ], 16 ))]))
655
655
test_node .wait_until (lambda : "cmpctblock" in test_node .last_message , timeout = 30 )
656
656
657
657
test_node .clear_block_announcement ()
@@ -660,7 +660,7 @@ def test_compactblocks_not_at_tip(self, test_node):
660
660
test_node .clear_block_announcement ()
661
661
with p2p_lock :
662
662
test_node .last_message .pop ("block" , None )
663
- test_node .send_message (msg_getdata ([CInv (MSG_CMPCT_BLOCK , int (new_blocks [0 ], 16 ))]))
663
+ test_node .send_without_ping (msg_getdata ([CInv (MSG_CMPCT_BLOCK , int (new_blocks [0 ], 16 ))]))
664
664
test_node .wait_until (lambda : "block" in test_node .last_message , timeout = 30 )
665
665
with p2p_lock :
666
666
test_node .last_message ["block" ].block .calc_sha256 ()
@@ -768,7 +768,7 @@ def announce_cmpct_block(node, peer):
768
768
block , cmpct_block = announce_cmpct_block (node , stalling_peer )
769
769
770
770
for tx in block .vtx [1 :]:
771
- delivery_peer .send_message (msg_tx (tx ))
771
+ delivery_peer .send_without_ping (msg_tx (tx ))
772
772
delivery_peer .sync_with_ping ()
773
773
mempool = node .getrawmempool ()
774
774
for tx in block .vtx [1 :]:
@@ -783,7 +783,7 @@ def announce_cmpct_block(node, peer):
783
783
784
784
block , cmpct_block = announce_cmpct_block (node , stalling_peer )
785
785
for tx in block .vtx [1 :]:
786
- delivery_peer .send_message (msg_tx (tx ))
786
+ delivery_peer .send_without_ping (msg_tx (tx ))
787
787
delivery_peer .sync_with_ping ()
788
788
789
789
cmpct_block .prefilled_txn [0 ].tx .wit .vtxinwit = [CTxInWitness ()]
0 commit comments