aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-03-08 04:31:34 +0000
committerAdam Soltys <[email protected]>2024-03-08 04:31:34 +0000
commit972ea530e8139a0357b6b45ccdf9742d19ba6a26 (patch)
treeeb2774d174c12e7304694d1793811d0ae0abf685 /routes
parent2bd73639038bbc9cd4c75758eda685c89011231f (diff)
downloadcoinos-server-972ea530e8139a0357b6b45ccdf9742d19ba6a26.tar.gz
coinos-server-972ea530e8139a0357b6b45ccdf9742d19ba6a26.zip
validate tips
Diffstat (limited to 'routes')
-rw-r--r--routes/info.js6
-rw-r--r--routes/invoices.js1
2 files changed, 6 insertions, 1 deletions
diff --git a/routes/info.js b/routes/info.js
index 13b1de57..f2e262f6 100644
--- a/routes/info.js
+++ b/routes/info.js
@@ -1,3 +1,4 @@
+import { archive } from "$lib/db";
import db from "$lib/db";
import ln from "$lib/ln";
@@ -7,10 +8,15 @@ export default {
let lnwallet;
let total = 0;
+
for await (let k of db.scanIterator({ MATCH: "balance:*" })) {
total += parseInt(await db.get(k));
}
+ for await (let k of archive.scanIterator({ MATCH: "balance:*" })) {
+ total += parseInt(await archive.get(k));
+ }
+
const funds = await ln.listfunds();
lnchannel = parseInt(funds.channels.reduce((a, b) => a + b.channel_sat, 0));
lnwallet = parseInt(funds.outputs.reduce((a, b) => a + b.value, 0));
diff --git a/routes/invoices.js b/routes/invoices.js
index 7a9a0d1d..5cc60e05 100644
--- a/routes/invoices.js
+++ b/routes/invoices.js
@@ -32,7 +32,6 @@ export default {
try {
res.send(await generate({ invoice, user, sender }));
} catch (e) {
- console.log(e);
bail(res, e.message);
}
},