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 <rusty@rustcorp.com.au>
This commit is contained in:
@@ -793,6 +793,12 @@ struct channel *any_channel_by_scid(struct lightningd *ld,
|
||||
if (chan->scid
|
||||
&& short_channel_id_eq(scid, *chan->scid))
|
||||
return chan;
|
||||
|
||||
/* Look through any old pre-splice channel ids */
|
||||
for (size_t i = 0; i < tal_count(chan->old_scids); i++) {
|
||||
if (short_channel_id_eq(scid, chan->old_scids[i]))
|
||||
return chan;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -499,7 +499,7 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor):
|
||||
assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
|
||||
def test_route_by_old_scid(node_factory, bitcoind):
|
||||
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'experimental-splicing': None})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user