aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/payments.ts')
-rw-r--r--lib/payments.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 88b9230d..98c4bc50 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -65,6 +65,9 @@ export const debit = async ({
let iid;
if (invoice) {
+ console.log("AMT", amount);
+ console.log("RCVD", invoice.received);
+ console.log(invoice.received >= amount);
if (invoice.received >= amount) fail("Invoice already paid");
({ id: iid } = invoice);
@@ -436,7 +439,8 @@ export const sendLightning = async ({
if (typeof amount !== "undefined") {
amount = parseInt(amount);
- if (amount < 0 || amount > SATS || isNaN(amount)) fail("Invalid amount");
+ if (amount < 0 || amount > SATS || Number.isNaN(amount))
+ fail("Invalid amount");
}
let total = amount;