Skip to content

Commit

Permalink
refactor blink
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Sep 22, 2024
1 parent 43209dd commit 643e1fb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cashu/lightning/blink.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ async def pay_invoice(
or "Unknown error"
)

result = PAYMENT_EXECUTION_RESULT_MAP[
resp.get("data", {}).get("lnInvoicePaymentSend", {}).get("status")
]
status_str = resp.get("data", {}).get("lnInvoicePaymentSend", {}).get("status")
result = PAYMENT_EXECUTION_RESULT_MAP[status_str]

if status_str == "ALREADY_PAID":
error_message = "Invoice already paid"

if resp.get("data", {}).get("lnInvoicePaymentSend", {}).get("transaction", {}):
fee = (
Expand Down

0 comments on commit 643e1fb

Please sign in to comment.