Skip to content

Commit e9e9391

Browse files
committed
[tests] Check connectivity before sending in assumevalid.py
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 passes, but this is a lot of noise in the test log. Just check that the connection is open before trying to send.
1 parent 09627b1 commit e9e9391

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)