Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use channel balance api in get balances (LND) #671

Merged
merged 3 commits into from
Sep 22, 2024
Merged

Conversation

im-adithya
Copy link
Member

Fixes #644

We recently saw an issue where people saw balance differently in Umbrel, Hub and the Extension

For example:

1 748 499 - Umbrel
1 747 569 - Extension
987 439 - Hub Node page

This PR makes the Hub Node page return the same balance as the extension. The difference of 930 between Umbrel and Extension is not solved by this PR as it is because of an unsettled HTLC (again, I suspect that it is an invoice of value 500 sats but this additional 430 sats is cut from the balance and I don't know why that is the case)

@@ -858,11 +869,11 @@ func (svc *LNDService) GetBalances(ctx context.Context) (*lnclient.BalancesRespo
return &lnclient.BalancesResponse{
Onchain: *onchainBalance,
Lightning: lnclient.LightningBalanceResponse{
TotalSpendable: totalSpendable,
TotalReceivable: totalReceivable,
TotalSpendable: int64(balances.LocalBalance.Msat),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not work - it does not remove the channel reserve.

@rolznz rolznz requested a review from bumi September 22, 2024 05:29
@rolznz
Copy link
Contributor

rolznz commented Sep 22, 2024

@im-adithya I fixed the balances so they discount the channel reserve, and added the missing calculations (these are useful from settings -> debug tools to check why you cannot make a payment)

@rolznz rolznz added this to the v1.9.0 milestone Sep 22, 2024
@rolznz rolznz merged commit f14a828 into master Sep 22, 2024
9 checks passed
@rolznz rolznz deleted the task-lnd-balance branch September 22, 2024 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hub on Umbrel | Spending Balance discrepancy between Alby Hub and LND app
2 participants