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

Give InsufficientBalance before trying to send #827

Merged
merged 2 commits into from
Nov 5, 2023
Merged

Conversation

benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented Nov 5, 2023

Closes #816

Before if we had a confirming channel we would still try to send and give a RouteNotFound error which could be confusing.

This fixes by first summing up the balance of our confirmed channels and seeing if we have enough balance.

We can remove the is_empty check because that will sum to 0

< send_msats
{
// Channels exist but not enough capacity
return Err(MutinyError::InsufficientBalance);
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be confusing if the user has some channels and balance but the connection to the LSP node is not currently active.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This handles that, is channel ready, only checks if it's been confirmed, not if they have an active connection.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh okay. Then it sounds like it is much better then but doesn't quite resolve the LSP disconnection problem, but I think that's what the UI designs for disconnections will have to fix.

@TonyGiorgio TonyGiorgio merged commit 0736faa into master Nov 5, 2023
9 checks passed
@TonyGiorgio TonyGiorgio deleted the channel-err branch November 5, 2023 18:18
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.

add error for when insufficient funds due to channel not being fully open yet
2 participants