diff options
| author | Adam Soltys <[email protected]> | 2022-11-02 15:56:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-11-02 15:56:58 -0700 |
| commit | 409aeb1d3de7bb7791725b9568986be5607a23f4 (patch) | |
| tree | 2f254c2a4ea4af34354f7b691b4a89b57db6c669 | |
| parent | 6f540461418e283f2c55478496aac403cfce72b8 (diff) | |
| download | coinos-server-409aeb1d3de7bb7791725b9568986be5607a23f4.tar.gz coinos-server-409aeb1d3de7bb7791725b9568986be5607a23f4.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( |
