-
Notifications
You must be signed in to change notification settings - Fork 407
Expose pending payment set from ChannelManager
#1157
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
Comments
Note that this is pretty important in part because race conditions on the users' end may lead to it being unclear if a payment is really in-flight - if a user goes to call The API here for this may be more complicated than just shoving them into |
@TheBlueMatt I'm trying to work on this issue alongside moving HTLC-tracking to I noticed we can derive most information about inflight payments by looking into I have a few questions that came out of my investigation so far:
Additionally, at a higher level: what is the current thinking around (1) an ideal API for exposing pending payments to users and (2) how to track inflight HTLCs in ChannelManager? I believe the @jkczyz mentioned at some point for (2) to consider either creating a new trait or adding |
One way or another, the pending HTLCs will need to be accessed through |
These are waiting to be failed back, they are no longer in-flight and should be ignored.
If we're waiting to add an HTLC, yes, we should count that.
ISTM we could just use |
That means while using |
Yes, I think we'll want independent solutions. If nothing else this API is going to want to include trampoline and forwarded HTLCs (and be HTLC-focused) whereas the pending-payments querying logic should communicate payment status (and maybe not even expose anything at the HTLC level yet, given the race concerns I highlighted previously). If we do the PaymentId-based idempotency stuff then I think we can feel more comfortable with exposing payment level data in a way that isn't intently race-y. |
Note that that won't solve the "what's my current balance" question, but that likely needs a third solution (or could go in the pending payment access) because it needs to consider which HTLCs are part of a forward and which are outbound (and look at the expected payment amount for outbound payments, not the current pending-HTLC amount). |
@TheBlueMatt I'm going to start looking to exposing pending payment information after landing #1830, but had a couple of questions to get us going:
@jkczyz and I also spoke offline about whether or not we should try and order the pending payments, but it looks like the only information we know about them is based on My initial intuition is that it is perhaps better to just say outright that the payments are unordered, leaving the user to figure out how to track their state by |
Yea, so I think we want to just do it based on the pending map, indeed. I dont think we want to expose the amount currently in-flight, but rather only the total and the status (retryable/fulfilled/abandoned). |
seeking concept ACK in PR above. let me know if I'm misunderstanding anything |
Fixed in #1873. |
Users probably need that, eg sample, see lightningdevkit/ldk-sample#40 (comment)
The text was updated successfully, but these errors were encountered: