Skip to content

Commit

Permalink
[tests] Check connectivity before sending in assumevalid.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jnewbery committed Sep 15, 2017
1 parent 09627b1 commit e9e9391
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/functional/assumevalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def setup_network(self):
def send_blocks_until_disconnected(self, node):
"""Keep sending blocks to the node until we're disconnected."""
for i in range(len(self.blocks)):
if not node.connection:
break
try:
node.send_message(msg_block(self.blocks[i]))
except IOError as e:
Expand Down

0 comments on commit e9e9391

Please sign in to comment.