aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-21 18:49:38 +0000
committerAdam Soltys <[email protected]>2024-02-21 18:49:38 +0000
commit60080d284f8d740cc9e1e42c7a4359053dedfb68 (patch)
treeb451c1393f255ea9b69d4af743169acf5ae57184
parent99860c48bc27f17d8c593dcfbaab494092e5b19c (diff)
downloadcoinos-server-60080d284f8d740cc9e1e42c7a4359053dedfb68.tar.gz
coinos-server-60080d284f8d740cc9e1e42c7a4359053dedfb68.zip
limit withdrawals
-rw-r--r--index.js2
-rw-r--r--lib/payments.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/index.js b/index.js
index ab1d1a5e..0564ea9e 100644
--- a/index.js
+++ b/index.js
@@ -64,7 +64,7 @@ app.post("/take", auth, payments.take);
app.post("/print", auth, payments.print);
app.post("/send/:lnaddress/:amount", auth, payments.lnaddress);
app.post("/gateway", payments.gateway);
-app.post("/replace", auth, payments.replace);
+// app.post("/replace", auth, payments.replace);
app.get("/encode", lnurl.encode);
app.get("/decode", lnurl.decode);
diff --git a/lib/payments.js b/lib/payments.js
index 2f603c98..754d2f0c 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -36,6 +36,8 @@ export let debit = async ({
type = types.internal,
rate,
}) => {
+ if (await g("freeze")) fail("Problem sending payment");
+ if (!user.verified && amount > 1000000) fail(`⚡️${amount} exceeds max withdrawal of ⚡️1,000,000`);
let ref;
let { id: uid, currency, username } = user;
if (!rate) rate = store.rates[currency];