aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-31 09:03:23 -0700
committerAdam Soltys <[email protected]>2024-10-31 09:03:23 -0700
commit2ff6a289f142636beee1846132049cae7cfd82ea (patch)
treea23313129b1aa54c8e7925471fc3e9f873192a86 /lib/payments.ts
parentb3203b848a25b5aadebfe8fff3e0f01dda1919fa (diff)
downloadcoinos-server-2ff6a289f142636beee1846132049cae7cfd82ea.tar.gz
coinos-server-2ff6a289f142636beee1846132049cae7cfd82ea.zip
detect internal payments
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;