aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'routes/payments.ts')
-rw-r--r--routes/payments.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index 67243a12..66fd3386 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -66,6 +66,11 @@ export default {
if (payreq != null && typeof payreq !== "string")
fail("Invalid payment request");
if (hash != null && typeof hash !== "string") fail("Invalid invoice");
+ // Invoices are keyed lowercase. An uppercase payreq (QR-scanned) missed
+ // the lookup below and was paid over cl to ourselves instead of
+ // internally; the listener then found the sender's payment:<bolt11>
+ // pointer and skipped crediting the recipient.
+ if (payreq) payreq = payreq.replace(/\s/g, "").toLowerCase();
if (typeof amount !== "undefined") {
amount = Number.parseInt(amount);