aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-26 21:48:27 -0800
committerAdam Soltys <[email protected]>2023-02-26 21:48:27 -0800
commitaf35a42356c46b7625e16f3a00567d027b8c8ba6 (patch)
tree6b58a57b0dab90c8a1effccbd0f30da15826ab8b
parent797d10c9322b2de3ec14fa85689ae70435e98c8f (diff)
downloadcoinos-server-af35a42356c46b7625e16f3a00567d027b8c8ba6.tar.gz
coinos-server-af35a42356c46b7625e16f3a00567d027b8c8ba6.zip
return total balance
-rw-r--r--routes/info.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/routes/info.js b/routes/info.js
index 45408269..ae347b56 100644
--- a/routes/info.js
+++ b/routes/info.js
@@ -6,9 +6,9 @@ export default {
let lnchannel;
let lnwallet;
- let b = 0;
+ let total = 0;
for await (let k of db.scanIterator({ MATCH: "balance:*" })) {
- b += parseInt(await db.get(k));
+ total += parseInt(await db.get(k));
}
const funds = await ln.listfunds();
@@ -18,7 +18,7 @@ export default {
const info = {
lnchannel,
lnwallet,
- total: lnchannel + lnwallet
+ total
};
res.send(info);