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: spendable balance in lnd #291

Merged
merged 1 commit into from
Jul 19, 2024
Merged

fix: spendable balance in lnd #291

merged 1 commit into from
Jul 19, 2024

Conversation

im-adithya
Copy link
Member

Issue

It is wrongly mentioned that -60000 sats are incoming although there are no channels waiting to be closed, and also this happens because total balance is less than the spendable balance (hence the -ve sign) which can never be the case
Screenshot 2024-07-18 at 7 41 45 PM

Description

This happens because we remove the ReservedBalance from the TotalBalance in LND which makes TotalBalance less than ConfirmedBalance

From LDK docs

total_onchain_balance_sats: u64
The total balance of our on-chain wallet.
spendable_onchain_balance_sats: u64
The currently spendable balance of our on-chain wallet.
This includes any sufficiently confirmed funds, minus total_anchor_channels_reserve_sats.

That's why we remove total_anchor_channels_reserve_sats from total_onchain_balance_sats in LDK

But in LND, spendable_onchain_balance_sats doesn't remove any reserves, it gives the actual confirmed balance. So this change subtracts total_anchor_channels_reserve_sats from both

@im-adithya im-adithya requested review from bumi and rolznz July 18, 2024 14:25
Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

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

utACK

@rolznz rolznz merged commit 80cac0b into master Jul 19, 2024
8 checks passed
@rolznz rolznz deleted the task-total-balance branch July 19, 2024 03:21
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.

2 participants