From b9f94f87ce37a5808a9274093b030e5ad8e2b7a4 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Nov 2022 15:56:44 -0700 Subject: increase max tip --- routes/invoices.js | 5 ++--- 1 file 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( -- cgit v1.2.3