-
Notifications
You must be signed in to change notification settings - Fork 1k
Renepay patch htlc_max=0 cases #7159
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -489,12 +489,12 @@ def test_htlc_max(node_factory): | |
| ] | ||
| ) | ||
|
|
||
| inv = l6.rpc.invoice("1800000sat", "inv", "description") | ||
| inv = l6.rpc.invoice("800000sat", "inv", "description") | ||
|
|
||
| l1.rpc.call("renepay", {"invstring": inv["bolt11"]}) | ||
| l1.wait_for_htlcs() | ||
| invoice = only_one(l6.rpc.listinvoices("inv")["invoices"]) | ||
| assert invoice["amount_received_msat"] >= Millisatoshi("1800000sat") | ||
| assert invoice["amount_received_msat"] >= Millisatoshi("800000sat") | ||
|
|
||
|
|
||
| def test_previous_sendpays(node_factory, bitcoind): | ||
|
|
@@ -624,3 +624,60 @@ def test_fees(node_factory): | |
| source.rpc.call("renepay", {"invstring": invstr}) | ||
| invoice = only_one(dest.rpc.listinvoices("inv2")["invoices"]) | ||
| assert invoice["amount_received_msat"] == Millisatoshi("150000sat") | ||
|
|
||
|
|
||
| def test_local_htlcmax0(node_factory): | ||
| """Testing a simple pay route when local channels have htlcmax=0.""" | ||
| l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True) | ||
| l1.rpc.setchannel(l2.info["id"], htlcmax=0) | ||
| inv = l3.rpc.invoice(123000, "test_renepay", "description")["bolt11"] | ||
| details = l1.rpc.call("renepay", {"invstring": inv}) | ||
| assert details["status"] == "complete" | ||
| assert details["amount_msat"] == Millisatoshi(123000) | ||
| assert details["destination"] == l3.info["id"] | ||
|
|
||
|
|
||
| def test_htlcmax0(node_factory): | ||
| """ | ||
| Topology: | ||
| 1----2----4 | ||
| | | | ||
| 3----5----6 | ||
| Tests the plugin when some routes have htlc_max=0. | ||
| """ | ||
| opts = [ | ||
| {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0}, | ||
| {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0}, | ||
| {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0}, | ||
| { | ||
| "disable-mpp": None, | ||
| "fee-base": 0, | ||
| "fee-per-satoshi": 0, | ||
| "htlc-maximum-msat": 0, | ||
| }, | ||
| { | ||
| "disable-mpp": None, | ||
| "fee-base": 0, | ||
| "fee-per-satoshi": 0, | ||
| "htlc-maximum-msat": 800000000, | ||
| }, | ||
| {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0}, | ||
| ] | ||
| l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts) | ||
| start_channels( | ||
| [ | ||
| (l1, l2, 10000000), | ||
| (l2, l4, 1000000), | ||
| (l4, l6, 1000000), | ||
| (l1, l3, 10000000), | ||
| (l3, l5, 1000000), | ||
| (l5, l6, 1000000), | ||
| ] | ||
| ) | ||
|
|
||
| inv = l6.rpc.invoice("600000sat", "inv", "description") | ||
|
|
||
| l1.rpc.call("renepay", {"invstring": inv["bolt11"]}) | ||
| l1.wait_for_htlcs() | ||
| invoice = only_one(l6.rpc.listinvoices("inv")["invoices"]) | ||
| assert invoice["amount_received_msat"] >= Millisatoshi("600000sat") | ||
|
Comment on lines
+680
to
+683
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not relevant to this PR, but I think that maybe would be good for this kind of testing to know what is the path that the payment is taking. Maybe we can add this as a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My idea was also to implement it inside vanilla pay
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice if renepay gave the successful paths in the response, though that's pretty verbose!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the response from |
||
Uh oh!
There was an error while loading. Please reload this page.