def wait_until_mn_status(self, status, mnTxHash, _timeout, orEmpty=False, with_ping_mns=[]):
    nodes_status = ([None] * self.num_nodes)

    def node_synced(i):
        return ((nodes_status[i] == status) or (orEmpty and (nodes_status[i] == '')))

    def all_synced():
        for i in range(self.num_nodes):
            if (not node_synced(i)):
                return False
        return True
    time.sleep(2)
    timeout = (time.time() + _timeout)
    while ((not all_synced()) and (time.time() < timeout)):
        for i in range(self.num_nodes):
            if (not node_synced(i)):
                nodes_status[i] = self.get_mn_status(self.nodes[i], mnTxHash)
        if (not all_synced()):
            time.sleep(2)
            self.send_pings(with_ping_mns)
    if (not all_synced()):
        strErr = ('Unable to get get status "%s" on all nodes for mnode %s. Current: %s' % (status, mnTxHash, str(nodes_status)))
        raise AssertionError(strErr)
def wait_until_mn_status(self, status, mnTxHash, _timeout, orEmpty=False, with_ping_mns=[]):
    nodes_status = ([None] * self.num_nodes)

    def node_synced(i):
        return ((nodes_status[i] == status) or (orEmpty and (nodes_status[i] == )))

    def all_synced():
        for i in range(self.num_nodes):
            if (not node_synced(i)):
                return False
        return True
    time.sleep(2)
    timeout = (time.time() + _timeout)
    while ((not all_synced()) and (time.time() < timeout)):
        for i in range(self.num_nodes):
            if (not node_synced(i)):
                nodes_status[i] = self.get_mn_status(self.nodes[i], mnTxHash)
        if (not all_synced()):
            time.sleep(2)
            self.send_pings(with_ping_mns)
    if (not all_synced()):
        strErr = ('Unable to get get status "%s" on all nodes for mnode %s. Current: %s' % (status, mnTxHash, str(nodes_status)))
        raise AssertionError(strErr)