Skip to content

Commit d70fc13

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 4abd0af commit d70fc13

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lightningd/channel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,12 @@ struct channel *any_channel_by_scid(struct lightningd *ld,
793793
if (chan->scid
794794
&& short_channel_id_eq(scid, *chan->scid))
795795
return chan;
796+
797+
/* Look through any old pre-splice channel ids */
798+
for (size_t i = 0; i < tal_count(chan->old_scids); i++) {
799+
if (short_channel_id_eq(scid, chan->old_scids[i]))
800+
return chan;
801+
}
796802
}
797803
}
798804
return NULL;

tests/test_splicing.py

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

501501

502-
@pytest.mark.xfail(strict=True)
502+
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
503503
def test_route_by_old_scid(node_factory, bitcoind):
504504
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'experimental-splicing': None})
505505

0 commit comments

Comments
 (0)