Skip to content

Commit 44e1fd9

Browse files
author
MarcoFalke
committed
Merge #11345: [tests] Check connectivity before sending in assumevalid.py
e9e9391 [tests] Check connectivity before sending in assumevalid.py (John Newbery) Pull request description: assumevalid.py would try to send over a closed P2P connection in a loop, hitting the following failure many times: `TestFramework.mininode (ERROR): Cannot send message. No connection to node!` The test still passed, but this is a lot of noise in the test log. Just check that the connection is open before trying to send. Tree-SHA512: 6faf2ce5717de976fed1b5c863bc8d17e785928690f833d5bf175178f95d39f455635a844fe7e0dfdad83ae779dd45bc6e4ed89a9467d8482c5be73b55095c8d
2 parents d6d2c85 + e9e9391 commit 44e1fd9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/assumevalid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def setup_network(self):
6868
def send_blocks_until_disconnected(self, node):
6969
"""Keep sending blocks to the node until we're disconnected."""
7070
for i in range(len(self.blocks)):
71+
if not node.connection:
72+
break
7173
try:
7274
node.send_message(msg_block(self.blocks[i]))
7375
except IOError as e:

0 commit comments

Comments
 (0)