round msats value
This commit is contained in:
parent
e96a6449ad
commit
3441d72b66
2 changed files with 3 additions and 4 deletions
|
|
@ -298,7 +298,7 @@ export default class {
|
||||||
return
|
return
|
||||||
case Payment_PaymentStatus.SUCCEEDED:
|
case Payment_PaymentStatus.SUCCEEDED:
|
||||||
this.log("invoice payment succeded", Number(payment.valueSat))
|
this.log("invoice payment succeded", Number(payment.valueSat))
|
||||||
res({ feeSat: Number(payment.feeSat), valueSat: Number(payment.valueSat), paymentPreimage: payment.paymentPreimage })
|
res({ feeSat: Math.round(Number(payment.feeMsat) / 1000), valueSat: Number(payment.valueSat), paymentPreimage: payment.paymentPreimage })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,8 @@ export class Watchdog {
|
||||||
this.log(Number(walletBalance.confirmedBalance), "sats in chain wallet")
|
this.log(Number(walletBalance.confirmedBalance), "sats in chain wallet")
|
||||||
const channelsBalance = await this.lnd.GetChannelBalance()
|
const channelsBalance = await this.lnd.GetChannelBalance()
|
||||||
getLogger({ component: "debugLndBalancev3" })({ w: walletBalance, c: channelsBalance, u: usersTotal, f: this.accumulatedHtlcFees })
|
getLogger({ component: "debugLndBalancev3" })({ w: walletBalance, c: channelsBalance, u: usersTotal, f: this.accumulatedHtlcFees })
|
||||||
|
const localChannelsBalance = channelsBalance.localBalance ? Math.round(Number(channelsBalance.localBalance.msat) / 1000) : 0
|
||||||
const localChannelsBalance = Number(channelsBalance.localBalance?.sat || 0)
|
const unsettledLocalBalance = channelsBalance.unsettledLocalBalance ? Math.round(Number(channelsBalance.unsettledLocalBalance.msat) / 1000) : 0
|
||||||
const unsettledLocalBalance = Number(channelsBalance.unsettledLocalBalance?.sat || 0)
|
|
||||||
return Number(walletBalance.confirmedBalance) + localChannelsBalance + unsettledLocalBalance
|
return Number(walletBalance.confirmedBalance) + localChannelsBalance + unsettledLocalBalance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue