Skip to content

Fix CLTV comparison for final_incorrect_cltv_expiry onion error #2513

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

Closed
valentinewallace opened this issue Aug 22, 2023 · 3 comments · Fixed by #2639
Closed

Fix CLTV comparison for final_incorrect_cltv_expiry onion error #2513

valentinewallace opened this issue Aug 22, 2023 · 3 comments · Fixed by #2639
Labels
good first issue Good for newcomers

Comments

@valentinewallace
Copy link
Contributor

On this line

if (outgoing_cltv_value as u64) <= current_height as u64 + HTLC_FAIL_BACK_BUFFER as u64 + 1 {
per BOLT 4, we should be using the update_add_htlc's cltv_expiry, not the CLTV expiry set by the sender in the onion.

Just needs a variable swap and a test. If no one gets to this I'll probably get around to it.

Shoutout to @carlaKC for catching this!

@valentinewallace valentinewallace added the good first issue Good for newcomers label Aug 22, 2023
@rjtch
Copy link

rjtch commented Aug 25, 2023

hey, can i work on this?

@valentinewallace
Copy link
Contributor Author

Go for it :)

@vladimirfomene
Copy link
Contributor

@valentinewallace, I asked @rjtch and he said I could take this up.

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.

3 participants