Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

LSPS2: check and return if fee has been skimmed #134

Closed

Conversation

johncantrell97
Copy link
Contributor

@johncantrell97 johncantrell97 commented May 13, 2024

Based on #137 and #135

Using skimmed_fee_msat in the payment forwarded event we should actually check to make sure the we have skimmed the correct amount of fees.

I subtract the skimmed fee from the expected fee to get a remaining fee. If remaining fee is 0 then the logic continues as before.

If the remaining fee is > 0 then it basically performs the htlc_handling_failed logic but uses the remaining fee as the expected fee. This is likely outside of the spec and should in theory never happen since we check to make sure we can skim the entire fee before attempting the forward in the first place.

I also updated the payment_forwarded function to return a boolean for whether or not the channel has been sufficiently paid for so the LSP can use the response to determine if it should release a held funding tx when using client trusts lsp.

@johncantrell97 johncantrell97 force-pushed the fee-collected branch 2 times, most recently from 77ab0f6 to 34d736e Compare May 15, 2024 16:48
@johncantrell97 johncantrell97 changed the title check and return if fee has been skimmed LSPS2: check and return if fee has been skimmed May 15, 2024
@johncantrell97 johncantrell97 force-pushed the fee-collected branch 2 times, most recently from 64fd326 to 5983ec0 Compare May 17, 2024 14:34
@tnull
Copy link
Collaborator

tnull commented Jan 6, 2025

Closing this as I'm about to archive this repository in favor of https://github.com/lightningdevkit/rust-lightning/tree/main/lightning-liquidity.

Please re-open the PR over there.

@tnull tnull closed this Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants