Skip to content

Commit 30afa74

Browse files
committed
lightningd: consider old scids when looking up channels (for routing).
Changelog-Fixed: Protocol: we now allow routing through old short-channel-ids once a splice is done (previously we would refuse, leading to a 6 block gap in service). Signed-off-by: Rusty Russell <[email protected]>
1 parent d912287 commit 30afa74

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lightningd/channel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,12 @@ struct channel *any_channel_by_scid(struct lightningd *ld,
781781
if (chan->scid
782782
&& short_channel_id_eq(scid, *chan->scid))
783783
return chan;
784+
785+
/* Look through any old pre-splice channel ids */
786+
for (size_t i = 0; i < tal_count(chan->old_scids); i++) {
787+
if (short_channel_id_eq(scid, chan->old_scids[i]))
788+
return chan;
789+
}
784790
}
785791
}
786792
return NULL;

tests/test_splicing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor):
423423
assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0
424424

425425

426-
@pytest.mark.xfail(strict=True)
427426
def test_route_by_old_scid(node_factory, bitcoind):
428427
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'experimental-splicing': None})
429428

0 commit comments

Comments
 (0)