Skip to content

Commit

Permalink
lnd: correct SpendableMsat and ReceivableMsat calc
Browse files Browse the repository at this point in the history
Fixes the calculation of the SpendableMsat and ReceivableMsat.
  • Loading branch information
YusukeShimizu committed Jul 19, 2024
1 parent 144f9d1 commit 76fa0cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lnd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (l *Client) SpendableMsat(scid string) (uint64, error) {
return 0, err
}
spendable := (uint64(ch.GetLocalBalance()) -
ch.GetLocalConstraints().GetChanReserveSat()*1000)
ch.GetLocalConstraints().GetChanReserveSat()) * 1000
// since the max htlc limit is not always set reliably,
// the check is skipped if it is not set.
if maxHtlcAmtMsat == 0 {
Expand Down Expand Up @@ -168,7 +168,7 @@ func (l *Client) ReceivableMsat(scid string) (uint64, error) {
return 0, err
}
receivable := (uint64(ch.GetRemoteBalance()) -
ch.GetRemoteConstraints().GetChanReserveSat()*1000)
ch.GetRemoteConstraints().GetChanReserveSat()) * 1000
// since the max htlc limit is not always set reliably,
// the check is skipped if it is not set.
if maxHtlcAmtMsat == 0 {
Expand Down

0 comments on commit 76fa0cb

Please sign in to comment.