diff options
| author | Adam Soltys <[email protected]> | 2022-11-02 15:56:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-02 15:56:51 -0700 |
| commit | b9f94f87ce37a5808a9274093b030e5ad8e2b7a4 (patch) | |
| tree | f10a48b4caa9ca9cf5a91914481620473484173d | |
| parent | e31957e3030a8d402a38062476915b4416aa8507 (diff) | |
| download | coinos-server-b9f94f87ce37a5808a9274093b030e5ad8e2b7a4.tar.gz coinos-server-b9f94f87ce37a5808a9274093b030e5ad8e2b7a4.zip | |
increase max tip
| -rw-r--r-- | routes/invoices.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/routes/invoices.js b/routes/invoices.js index 3a7f16b5..16abab84 100644 --- a/routes/invoices.js +++ b/routes/invoices.js @@ -64,7 +64,7 @@ app.post("/invoice", optionalAuth, async (req, res, next) => { let address, unconfidential, text; if (amount < 0) throw new Error("amount out of range"); - if (tip > amount || tip > 1000000 || tip < 0) + if (tip > 5 * amount || tip > 1000000 || tip < 0) throw new Error("tip amount out of range"); if (!user) ({ user } = req); @@ -82,8 +82,7 @@ app.post("/invoice", optionalAuth, async (req, res, next) => { if (!user) throw new Error("user not provided"); if (!currency) currency = user.currency; if (!rate) rate = store.rates[currency]; - if (tip > amount || tip > 1000000) throw new Error("tip is too large"); - if (tip < 0 || amount < 0) throw new Error("invalid amount"); + if (amount < 0) throw new Error("invalid amount"); if (user.account.pubkey) { let { address, confidentialAddress } = await deriveAddress( |
