aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-02 15:56:44 -0700
committerAdam Soltys <[email protected]>2022-11-02 15:56:58 -0700
commit409aeb1d3de7bb7791725b9568986be5607a23f4 (patch)
tree2f254c2a4ea4af34354f7b691b4a89b57db6c669
parent6f540461418e283f2c55478496aac403cfce72b8 (diff)
downloadcoinos-server-409aeb1d3de7bb7791725b9568986be5607a23f4.tar.gz
coinos-server-409aeb1d3de7bb7791725b9568986be5607a23f4.zip
increase max tip
-rw-r--r--routes/invoices.js5
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(