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

[feature]: Expose negotiated confirmation count for pending 'channel open' transactions #9452

Open
myxmaster opened this issue Jan 27, 2025 · 4 comments
Assignees
Labels
channels enhancement Improvements to existing features / behaviour good first issue Issues suitable for first time contributors to LND rpc Related to the RPC interface

Comments

@myxmaster
Copy link
Contributor

(As far as I know:) Currently, LND automatically negotiates with remote node the required number of confirmations for a channel to transition from "pending" to "open" status. However, this information is not accessible via the API.

I think it would be useful, because wallets can then display more accurate confirmation progress.

@myxmaster myxmaster added the enhancement Improvements to existing features / behaviour label Jan 27, 2025
@saubyk
Copy link
Collaborator

saubyk commented Jan 28, 2025

Hi @myxmaster isn't this something you can track on your own at the wallet level?

LND marks the channel as 'active' after 3 confirmations (there is no negotiation on this). An active channel is ready to send/receive payments.

Do keep in mind that a channel is announced (broadcast to other nodes) only after 6 confirmations. Channel announcement is relevant to routing nodes, which I am assuming is not the use case you're worried about.

@myxmaster
Copy link
Contributor Author

Hi @saubyk ah ok, so it is always 3 confirmations, no matter what? (I couldn't find details about this.)
-> Then yes, no need to ask LND backend about the required number of confirmations of course.

Do keep in mind that a channel is announced (broadcast to other nodes) only after 6 confirmations. Channel announcement is relevant to routing nodes, which I am assuming is not the use case you're worried about.

Yes, I just wanted to display more accurate information to the user, so it is more clear when the channel will go from "Pending" to "Active". But good to know that for channel announcement 6 confirmations are required. I guess for that case it makes sense to display the number of confirmations until 6 are reached... I'll think about it.

Thank you!

@kaloudis
Copy link
Contributor

Doesn't this vary by node config? See https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf#L652

@ziggie1984
Copy link
Collaborator

This is a good beginner issue laying out the way here if some new contributer whats to tackle this one:

  1. Introduce a new RPC field to PendingChannelsResponse_PendingOpenChannel something like confirmation_until_confirmed

  2. Use the shortchannel id to find out the confirmation height => then calculate the number of blocks still required to confirm via the current height, the confirmation height and the NumConfsRequired in the OpenChannel struct
    => relevant function to change func (r *rpcServer) fetchPendingOpenChannels() (pendingOpenChannels, error) {

That should be it.

Let me know if you need help!

@ziggie1984 ziggie1984 added good first issue Issues suitable for first time contributors to LND rpc Related to the RPC interface channels labels Jan 30, 2025
@saubyk saubyk self-assigned this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channels enhancement Improvements to existing features / behaviour good first issue Issues suitable for first time contributors to LND rpc Related to the RPC interface
Projects
None yet
Development

No branches or pull requests

4 participants