[qa] mininode: Expose connection state through is_connected

This commit is contained in:
MarcoFalke committed 2018-06-22 12:00:00 -04:00
1 parent ac3224c8ee
commit fa1eac9cdb
5 files changed
+51 -47

No files matched your search

+2 -2
View File
@@ -68,12 +68,12 @@ class AssumeValidTest(BitcoinTestFramework):
def send_blocks_until_disconnected(self, p2p_conn):
"""Keep sending blocks to the node until we're disconnected."""
for i in range(len(self.blocks)):
if p2p_conn.state != "connected":
if not p2p_conn.is_connected:
break
try:
p2p_conn.send_message(msg_block(self.blocks[i]))
except IOError as e:
assert str(e) == 'Not connected, no pushbuf'
assert not p2p_conn.is_connected
break
def assert_blockchain_height(self, node, height):