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

json_sendpay() can pick the wrong local channel #5504

Closed
wtogami opened this issue Aug 8, 2022 · 1 comment · Fixed by #5505
Closed

json_sendpay() can pick the wrong local channel #5504

wtogami opened this issue Aug 8, 2022 · 1 comment · Fixed by #5505
Milestone

Comments

@wtogami
Copy link
Contributor

wtogami commented Aug 8, 2022

Version: pre-0.12 da0b651

Unexpected behavior: json_sendpay() can pick the wrong channel despite you specifying a particular local channel for firsthop. You expect json_sendpay() to be the low-level function that does exactly what you ask of it.

Currently send_payment_core() is used by both json_sendpay() RPC and also onion forwards where it uses the function find_channel_for_htlc_add() for non-strict forwarding as required by BOLT 4.

Christian Decker approved a plan where we pass a new boolean flag named strict_first to differentiate firsthop from onion forwarding.

nepet@e49f647
Draft patch v0 Feedback welcome!

  • Currently missing: tests
  • Maybe the implementation could be cleaner

Please confirm this logic:

  • We want json_sendpay() to fail if the firsthop channel you specify is incapable. In this case we do not want it to pick a different channel. Right?
@niftynei niftynei added this to the v0.12 milestone Aug 8, 2022
@wtogami
Copy link
Contributor Author

wtogami commented Aug 8, 2022

#5505 fixed this in a different way.

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 a pull request may close this issue.

2 participants