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

Bug: Missing node name/ID in pending channel closure alert #1026

Open
rolznz opened this issue Jan 27, 2025 · 3 comments
Open

Bug: Missing node name/ID in pending channel closure alert #1026

rolznz opened this issue Jan 27, 2025 · 3 comments
Assignees
Milestone

Comments

@rolznz
Copy link
Contributor

rolznz commented Jan 27, 2025

Image

@rolznz rolznz added this to the v.1.14.0 milestone Jan 27, 2025
@rolznz rolznz self-assigned this Jan 27, 2025
@im-adithya
Copy link
Member

I think this happens when there is a PendingSweepBalance because then we don't add the pendingBalancesDetails

hub/lnclient/ldk/ldk.go

Lines 1066 to 1075 in 73540ef

for _, balance := range balances.PendingBalancesFromChannelClosures {
switch pendingType := (balance).(type) {
case ldk_node.PendingSweepBalancePendingBroadcast:
pendingBalancesFromChannelClosures += pendingType.AmountSatoshis
case ldk_node.PendingSweepBalanceBroadcastAwaitingConfirmation:
pendingBalancesFromChannelClosures += pendingType.AmountSatoshis
case ldk_node.PendingSweepBalanceAwaitingThresholdConfirmations:
pendingBalancesFromChannelClosures += pendingType.AmountSatoshis
}
}

I think it's best to skip when pendingBalancesDetails is empty since by then the channel is properly closed and is not listed in ListChannels response so we don't even fetch the remote node's info to display the alias (and we only have the channel id (see PendingSweepBalance docs) so I'm not sure if we can even fetch the node pubkey using it)

@rolznz
Copy link
Contributor Author

rolznz commented Jan 29, 2025

@im-adithya thanks for looking into it! I don't agree though - if the funds are not swept yet then there are no incoming funds that we can show next to the onchain balance. ListChannels only returns channels which have no closure initiated yet.

@rdmitr are you able to see if it's possible to include some additional fields in balances.PendingBalancesFromChannelClosures such as the CounterpartyNodeId, FundingTxId and FundingTxIndex similar to what you did in getAlby/ldk-node#60? in Alby Hub as Adithya linked above, we handle those ones differently.

@rolznz rolznz modified the milestones: v.1.14.0, v1.15.0 Jan 29, 2025
@rdmitr
Copy link
Collaborator

rdmitr commented Jan 31, 2025

Yep, I'll look into this!

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

No branches or pull requests

3 participants