diff options
| author | Adam Soltys <[email protected]> | 2024-03-14 16:47:03 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-03-14 16:47:03 +0000 |
| commit | f9a442a175e2d19df48137046f4ec28d07560ff8 (patch) | |
| tree | 63539035060e7ca00e87a5a77b294bbc1d3149d4 /lib | |
| parent | 972ea530e8139a0357b6b45ccdf9742d19ba6a26 (diff) | |
| download | coinos-server-f9a442a175e2d19df48137046f4ec28d07560ff8.tar.gz coinos-server-f9a442a175e2d19df48137046f4ec28d07560ff8.zip | |
validate rate
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/invoices.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/invoices.js b/lib/invoices.js index 633072f3..de29e74b 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -40,7 +40,8 @@ export let generate = async ({ invoice, user, sender, }) => { if (!rate) rate = store.rates[currency]; if (fiat) amount = Math.round((SATS * fiat) / rate); if (amount < 0) fail("invalid amount"); - if (tip< 0) fail("invalid tip"); + if (tip < 0) fail("invalid tip"); + if (rate < 0) fail("invalid rate"); if (memo && memo.length > 200) fail("memo too long"); let id = v4(); |
