do not chcek melt status before payment attempt (#443)

This commit is contained in:
callebtc
2024-02-18 23:26:55 +01:00
committed by GitHub
parent c4e8618cad
commit a3145a93d5
2 changed files with 12 additions and 8 deletions

View File

@@ -287,7 +287,8 @@ class BlinkWallet(LightningBackend):
return PaymentResponse(ok=False, error_message=str(e))
resp: dict = r.json()
# no result found
# no result found, this payment has not been attempted before
if (
not resp.get("data", {})
.get("me", {})
@@ -305,7 +306,7 @@ class BlinkWallet(LightningBackend):
.get("transactionsByPaymentHash")
)
# Blink API edge case: for a failed payment attempt, it returns two payments with the same hash
# Blink API edge case: for a previously failed payment attempt, it returns the two payments with the same hash
# if there are two payments with the same hash with "direction" == "SEND" and "RECEIVE"
# it means that the payment previously failed and we can ignore the attempt and return
# PaymentStatus(paid=None)