def set_invoice_status(self, key: str, status: int) -> None:
    if (status == PR_INFLIGHT):
        self.inflight_payments.add(key)
    elif (key in self.inflight_payments):
        self.inflight_payments.remove(key)
    if (status in SAVED_PR_STATUS):
        self.set_payment_status(bfh(key), status)
    util.trigger_callback('invoice_status', self.wallet, key)
def set_invoice_status(self, key: str, status: int) -> None:
    if (status == PR_INFLIGHT):
        self.inflight_payments.add(key)
    elif (key in self.inflight_payments):
        self.inflight_payments.remove(key)
    if (status in SAVED_PR_STATUS):
        self.set_payment_status(bfh(key), status)
    util.trigger_callback('invoice_status', self.wallet, key)