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

Expose HTLCs in ChannelDetails #2087

Open
TheBlueMatt opened this issue Mar 8, 2023 · 9 comments
Open

Expose HTLCs in ChannelDetails #2087

TheBlueMatt opened this issue Mar 8, 2023 · 9 comments
Labels
good first issue Good for newcomers

Comments

@TheBlueMatt
Copy link
Collaborator

We should expose the list of in-flight HTLCs in ChannelDetails, cause why not. This should let us better figure out what the timeline is for the channel close. We should also expose if a channel is actively shutting down and maybe if a peer is currently connected in ChannelDetails. May help with visibility into #2086.

@tnull tnull added the good first issue Good for newcomers label Mar 9, 2023
@ayeankit
Copy link

hey @TheBlueMatt, Is this still open? i would like to work on this.

@TheBlueMatt
Copy link
Collaborator Author

Sure, go for it!

@TheBlueMatt
Copy link
Collaborator Author

TheBlueMatt commented Mar 13, 2023

I think, rather than listing explicit HTLCs pending, maybe we should just expose the total in flight amounts, preferably by type (outbound-vs-forwarded).

@aniket2405
Copy link

hey, it seems that the PR for this was not accepted and closed. Is this still open then? If yes, I would like to work on this.

@aniket2405
Copy link

aniket2405 commented Apr 6, 2023

Do these fields in the ChannelDetails struct in the ln::channelmanager module make sense to expose the HTLCs? The first is present already, what about the rest?

pub struct ChannelDetails {
pub channel_id: [u8; 32],
pub local_balance: u64,
pub remote_balance: u64,
pub remote_pubkey: PublicKey,
pub channel_value_satoshis: u64,
pub user_id: UserId,
pub in_flight_htlcs: Vec<(PaymentHash, u64, HTLCType)>,
pub is_shutting_down: bool,
pub peer_connected: bool,
}

@TheBlueMatt
Copy link
Collaborator Author

I don't think we need to expose the payment hash, but rather in HTLCType we should expose eg the previous channel and htlc_id for forwarded payments.

@tlulu
Copy link

tlulu commented Jul 17, 2023

Is anyone actively working on this? If not, I would like to work on this. For context, I want to expose an HTLC's cltv_expiry.

Alternatively would an API to query LDK be better? E.g

fn get_htlc(payment_hash: PaymentHash) -> HtlcDetails

pub struct HtlcDetails {
  pub absolute_cltv_expiry: Duration
  pub payment_hash: PaymentHash
}

@TheBlueMatt
Copy link
Collaborator Author

I think @wvanlint may be - is that still being worked on?

@wvanlint
Copy link
Contributor

Yes, sent out #2442 for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants