[qa] mininode: Expose connection state through is_connected

This commit is contained in:
MarcoFalke
2018-06-20 21:24:29 -04:00
parent ac3224c8ee
commit fa1eac9cdb
5 changed files with 51 additions and 47 deletions

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):