From ed4538ca280c7f4a0f0221ae214626234a1a4974 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 30 Dec 2024 16:54:38 -0800 Subject: set lnurlw min withdrawal to 1 sat --- routes/payments.ts | 2 +- routes/users.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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"]); -- cgit v1.2.3