aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-03-28 18:02:38 +0000
committerAdam Soltys <[email protected]>2025-03-28 18:02:47 +0000
commit425e712177de6f2d47e7d0486a347f0cbf4e0d0d (patch)
treef80a67393cf381258027edc445273c8c92a1cefd
parent6793e625f3be380c10cbc7bfc08b30d7ce7dae5c (diff)
downloadcoinos-server-425e712177de6f2d47e7d0486a347f0cbf4e0d0d.tar.gz
coinos-server-425e712177de6f2d47e7d0486a347f0cbf4e0d0d.zip
remove total user balances
-rw-r--r--lib/ecash.ts1
-rw-r--r--lib/payments.ts4
-rw-r--r--routes/info.ts15
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/ecash.ts b/lib/ecash.ts
index 5a5776b5..bcd2b7f4 100644
--- a/lib/ecash.ts
+++ b/lib/ecash.ts
@@ -13,6 +13,7 @@ import {
getEncodedTokenV4,
} from "@cashu/cashu-ts";
+
const { URL } = process.env;
const m = new CashuMint(config.mintUrl);
const w = new CashuWallet(m);
diff --git a/lib/payments.ts b/lib/payments.ts
index 07004fa2..24eed057 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -521,8 +521,10 @@ export const sendLightning = async ({
if (typeof amount !== "undefined") {
amount = parseInt(amount);
- if (amount < 0 || amount > SATS || Number.isNaN(amount))
+ if (amount < 0 || amount > SATS || Number.isNaN(amount)) {
+ warn("invalid amount", amount);
fail("Invalid amount");
+ }
}
let { type, invoice_amount_msat, amount_msat, invoice_node_id, payee } =
diff --git a/routes/info.ts b/routes/info.ts
index e24d4621..c6d03e4d 100644
--- a/routes/info.ts
+++ b/routes/info.ts
@@ -7,13 +7,13 @@ export default {
async balances(_, res) {
let total = 0;
- for await (const k of db.scanIterator({ MATCH: "balance:*" })) {
- total += parseInt(await db.get(k));
- }
-
- for await (const k of archive.scanIterator({ MATCH: "balance:*" })) {
- total += parseInt(await archive.get(k));
- }
+ // for await (const k of db.scanIterator({ MATCH: "balance:*" })) {
+ // total += parseInt(await db.get(k));
+ // }
+ //
+ // for await (const k of archive.scanIterator({ MATCH: "balance:*" })) {
+ // total += parseInt(await archive.get(k));
+ // }
const funds = await ln.listfunds();
const lnchannel = parseInt(
@@ -30,7 +30,6 @@ export default {
cash,
lnchannel,
lnwallet,
- total,
};
res.send(info);