From 12babb7d4e75066e29e82a2a64bef4099edeeff4 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 20 Feb 2023 14:04:31 -0800 Subject: fix balances endpoint --- routes/info.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/routes/info.js b/routes/info.js index 017e473a..eda028d2 100644 --- a/routes/info.js +++ b/routes/info.js @@ -6,16 +6,10 @@ export default { let lnchannel; let lnwallet; - const stream = db.scanStream({ - match: "balance:*", - count: 100 - }); - let b = 0; - for await (let keys of stream) { - for (let k of keys) b += parseInt(await db.get(k)); + for await (let k of db.scanIterator({ MATCH: "balance:*" })) { + b += parseInt(await db.get(k)); } - console.log(b); const funds = await ln.listfunds(); lnchannel = parseInt(funds.channels.reduce((a, b) => a + b.channel_sat, 0)); -- cgit v1.2.3