Skip to content

Commit 9181505

Browse files
Lagrang3cdecker
authored andcommitted
renepay: fix CLTV value for the first hop
Changelog-Fixed: renepay: fix the computation of the CLTV for the first hop, it was double counting the current blockheight leading to too 900k blocks into the future. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1 parent 40a74a7 commit 9181505

4 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎contrib/msggen/msggen/schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24597,7 +24597,7 @@
2459724597
"updated_index": 113,
2459824598
"short_channel_id": "116x1x1",
2459924599
"id": 11,
24600-
"expiry": 281,
24600+
"expiry": 143,
2460124601
"direction": "out",
2460224602
"amount_msat": 400000,
2460324603
"payment_hash": "3fe5289854b8924b4ebb3f61cd8f5a29f8f509cc781919230f7ee95ec2fa7c46",

‎doc/schemas/listhtlcs.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
"updated_index": 113,
315315
"short_channel_id": "116x1x1",
316316
"id": 11,
317-
"expiry": 281,
317+
"expiry": 143,
318318
"direction": "out",
319319
"amount_msat": 400000,
320320
"payment_hash": "3fe5289854b8924b4ebb3f61cd8f5a29f8f509cc781919230f7ee95ec2fa7c46",

‎plugins/renepay/routetracker.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ struct command_result *route_sendpay_request(struct command *cmd,
449449
json_add_amount_msat(req->js, "amount_msat", hop->amount);
450450
json_add_node_id(req->js, "id", &hop->node_id);
451451
json_add_short_channel_id(req->js, "channel", hop->scid);
452-
json_add_num(req->js, "delay",
453-
hop->delay + payment->blockheight);
452+
json_add_num(req->js, "delay", hop->delay);
454453
json_object_end(req->js);
455454

456455
// FIXME: No localinvreqid is provided

‎tests/test_renepay.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ def test_unannounced(node_factory):
876876
assert ret["status"] == "complete"
877877

878878

879-
@pytest.mark.xfail(strict=True)
880879
def test_cltv_value(node_factory, bitcoind):
881880
cltv_delta = 5
882881
l1, l2, l3 = node_factory.line_graph(

0 commit comments

Comments
 (0)