aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-09-15 14:36:12 -0400
committerJohn Newbery <john@johnnewbery.com>2017-09-15 14:38:18 -0400
commite9e9391083721ca9733cc00a1907384f83b6435e (patch)
tree0de644e93aa9e2db6b2256267ed5ae1286095cbb /test
parent09627b1dd41d1151a709d5ead82a924bf59e3d38 (diff)
[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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/assumevalid.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/assumevalid.py b/test/functional/assumevalid.py
index beaf8c7055..65685c48b7 100755
--- a/test/functional/assumevalid.py
+++ b/test/functional/assumevalid.py
@@ -68,6 +68,8 @@ class AssumeValidTest(BitcoinTestFramework):
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: