diff options
| author | Adam Soltys <[email protected]> | 2024-10-31 09:03:23 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-31 09:03:23 -0700 |
| commit | 2ff6a289f142636beee1846132049cae7cfd82ea (patch) | |
| tree | a23313129b1aa54c8e7925471fc3e9f873192a86 /lib/payments.ts | |
| parent | b3203b848a25b5aadebfe8fff3e0f01dda1919fa (diff) | |
| download | coinos-server-2ff6a289f142636beee1846132049cae7cfd82ea.tar.gz coinos-server-2ff6a289f142636beee1846132049cae7cfd82ea.zip | |
detect internal payments
Diffstat (limited to 'lib/payments.ts')
| -rw-r--r-- | lib/payments.ts | 6 |
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; |
