def run(self):
    while self.running:
        if (not self.keyhashes):
            time.sleep(2)
            continue
        for keyhash in self.keyhashes:
            if (keyhash in self.received):
                continue
            try:
                message = server.get(keyhash)
            except Exception as e:
                self.print_error('cannot contact cosigner pool')
                time.sleep(30)
                continue
            if message:
                self.received.add(keyhash)
                self.print_error('received message for', keyhash)
                self.parent.obj.cosigner_receive_signal.emit(keyhash, message)
        time.sleep(30)
def run(self):
    while self.running:
        if (not self.keyhashes):
            time.sleep(2)
            continue
        for keyhash in self.keyhashes:
            if (keyhash in self.received):
                continue
            try:
                message = server.get(keyhash)
            except Exception as e:
                self.print_error('cannot contact cosigner pool')
                time.sleep(30)
                continue
            if message:
                self.received.add(keyhash)
                self.print_error('received message for', keyhash)
                self.parent.obj.cosigner_receive_signal.emit(keyhash, message)
        time.sleep(30)