def get_invoice_status(self, invoice: LNInvoice) -> int:
    key = invoice.rhash
    log = self.logs[key]
    if (key in self.inflight_payments):
        return PR_INFLIGHT
    status = self.get_payment_status(bfh(key))
    if ((status == PR_UNPAID) and log):
        status = PR_FAILED
    return status
def get_invoice_status(self, invoice: LNInvoice) -> int:
    key = invoice.rhash
    log = self.logs[key]
    if (key in self.inflight_payments):
        return PR_INFLIGHT
    status = self.get_payment_status(bfh(key))
    if ((status == PR_UNPAID) and log):
        status = PR_FAILED
    return status