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

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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
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

Successfully merging this pull request may close these issues.

None yet

1 participant