aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-30 16:54:38 -0800
committerAdam Soltys <[email protected]>2024-12-30 16:54:38 -0800
commited4538ca280c7f4a0f0221ae214626234a1a4974 (patch)
tree18a709d09ddab8fdec17f38c0b561332c21b285b
parent8b019c4583bfd6676ea39ef16e9606316d269538 (diff)
downloadcoinos-server-ed4538ca280c7f4a0f0221ae214626234a1a4974.tar.gz
coinos-server-ed4538ca280c7f4a0f0221ae214626234a1a4974.zip
set lnurlw min withdrawal to 1 sat
-rw-r--r--routes/payments.ts2
-rw-r--r--routes/users.ts2
2 files changed, 3 insertions, 1 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index 665e0014..3e59fb0f 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -239,7 +239,7 @@ export default {
callback: `${URL}/api/lnurlw`,
k1: name,
defaultDescription: `Withdraw from coinos fund ${name}`,
- minWithdrawable: balance * 1000,
+ minWithdrawable: balance > 0 ? 1000 : 0,
maxWithdrawable: balance * 1000,
});
},
diff --git a/routes/users.ts b/routes/users.ts
index 87797cce..3f453141 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -371,6 +371,8 @@ export default {
fail("Invalid signature or challenge mismatch.");
let user = await getUser(event.pubkey);
+ if (!user) fail("Pubkey not found");
+
const { username } = user;
l("logging in", username, req.headers["cf-connecting-ip"]);