diff options
| author | Adam Soltys <[email protected]> | 2021-08-03 01:52:33 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-03 01:52:33 -0700 |
| commit | e5e2bcf015b128c71cacf125d6aea4a0dddd30c3 (patch) | |
| tree | 09af4085f72fa2466cb0f66768be6e882be30f81 /routes/invoices.js | |
| parent | 2f52a91c5babde9e374dd9c532448f565bcbfeee (diff) | |
| parent | 1fbae57bb9540b1c116efc367809ac01ae2e9df2 (diff) | |
| download | coinos-server-e5e2bcf015b128c71cacf125d6aea4a0dddd30c3.tar.gz coinos-server-e5e2bcf015b128c71cacf125d6aea4a0dddd30c3.zip | |
Merge branch 'prod' into dev
Diffstat (limited to 'routes/invoices.js')
| -rw-r--r-- | routes/invoices.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/invoices.js b/routes/invoices.js index c188811e..51906b8c 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -27,6 +27,10 @@ app.post( let { liquidAddress, invoice, user, tx } = req.body; let { blindkey } = invoice; + if (invoice.amount < 0) throw new Error("amount out of range"); + if (invoice.tip > invoice.amount || invoice.tip > 1000000 || invoice.tip < 0) + throw new Error("tip amount out of range"); + if (liquidAddress) { l.info("conversion request for", liquidAddress, invoice.text); convert[invoice.text] = { address: liquidAddress, tx }; |
