breakdown lnd balance

This commit is contained in:
boufni95 2024-04-04 00:31:19 +02:00
parent 766224ba01
commit c708027529

View file

@ -49,6 +49,7 @@ export class Watchdog {
getTotalLndBalance = async () => {
const { confirmedBalance, channelsBalance } = await this.lnd.GetBalance()
this.log(confirmedBalance, "sats in chain wallet")
let total = confirmedBalance
channelsBalance.forEach(c => {
let outgoingSats = 0
@ -58,6 +59,7 @@ export class Watchdog {
}
})
total += Number(c.localBalanceSats) - outgoingSats
this.log(c.localBalanceSats, "sats in channel", c.channelId, "with", outgoingSats, "sats in pending outgoing htlcs")
})
return total
}