diff options
| author | Adam Soltys <[email protected]> | 2024-03-08 04:31:34 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-03-08 04:31:34 +0000 |
| commit | 972ea530e8139a0357b6b45ccdf9742d19ba6a26 (patch) | |
| tree | eb2774d174c12e7304694d1793811d0ae0abf685 /routes | |
| parent | 2bd73639038bbc9cd4c75758eda685c89011231f (diff) | |
| download | coinos-server-972ea530e8139a0357b6b45ccdf9742d19ba6a26.tar.gz coinos-server-972ea530e8139a0357b6b45ccdf9742d19ba6a26.zip | |
validate tips
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/info.js | 6 | ||||
| -rw-r--r-- | routes/invoices.js | 1 |
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); } }, |
