mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 18:52:29 +02:00
scripted-diff: test: Rename send_message to send_without_ping
send_message only drops the bytes in a buffer and a sync is needed to
avoid intermittent test issues. Change the name of the method to make
this more apparent during review.
-BEGIN VERIFY SCRIPT-
sed -i 's/send_message(/send_without_ping(/g' $( git grep -l 'send_message(' )
-END VERIFY SCRIPT-
This commit is contained in:
@@ -58,7 +58,7 @@ class BaseNode(P2PInterface):
|
||||
def send_header_for_blocks(self, new_blocks):
|
||||
headers_message = msg_headers()
|
||||
headers_message.headers = [CBlockHeader(b) for b in new_blocks]
|
||||
self.send_message(headers_message)
|
||||
self.send_without_ping(headers_message)
|
||||
|
||||
|
||||
class AssumeValidTest(BitcoinTestFramework):
|
||||
@@ -80,7 +80,7 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
if not p2p_conn.is_connected:
|
||||
break
|
||||
try:
|
||||
p2p_conn.send_message(msg_block(self.blocks[i]))
|
||||
p2p_conn.send_without_ping(msg_block(self.blocks[i]))
|
||||
except IOError:
|
||||
assert not p2p_conn.is_connected
|
||||
break
|
||||
@@ -157,7 +157,7 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
|
||||
# Send all blocks to node1. All blocks will be accepted.
|
||||
for i in range(2202):
|
||||
p2p1.send_message(msg_block(self.blocks[i]))
|
||||
p2p1.send_without_ping(msg_block(self.blocks[i]))
|
||||
# Syncing 2200 blocks can take a while on slow systems. Give it plenty of time to sync.
|
||||
p2p1.sync_with_ping(timeout=960)
|
||||
assert_equal(self.nodes[1].getblock(self.nodes[1].getbestblockhash())['height'], 2202)
|
||||
|
||||
Reference in New Issue
Block a user