@@ -424,10 +424,11 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor):
424
424
425
425
426
426
def test_route_by_old_scid (node_factory , bitcoind ):
427
- l1 , l2 , l3 = node_factory .line_graph (3 , wait_for_announce = True , opts = {'experimental-splicing' : None })
427
+ l1 , l2 , l3 = node_factory .line_graph (3 , wait_for_announce = True , opts = {'experimental-splicing' : None , 'may_reconnect' : True })
428
428
429
429
# Get pre-splice route.
430
430
inv = l3 .rpc .invoice (10000000 , 'test_route_by_old_scid' , 'test_route_by_old_scid' )
431
+ inv2 = l3 .rpc .invoice (10000000 , 'test_route_by_old_scid2' , 'test_route_by_old_scid2' )
431
432
route = l1 .rpc .getroute (l3 .info ['id' ], 10000000 , 1 )['route' ]
432
433
433
434
# Do a splice
@@ -448,3 +449,28 @@ def test_route_by_old_scid(node_factory, bitcoind):
448
449
# Now l1 tries to send using old scid: should work
449
450
l1 .rpc .sendpay (route , inv ['payment_hash' ], payment_secret = inv ['payment_secret' ])
450
451
l1 .rpc .waitsendpay (inv ['payment_hash' ])
452
+
453
+ # Let's splice again, so the original scid is two behind the times.
454
+ l3 .fundwallet (200000 )
455
+ funds_result = l3 .rpc .fundpsbt ("109000sat" , "slow" , 166 , excess_as_change = True )
456
+ chan_id = l3 .get_channel_id (l2 )
457
+ result = l3 .rpc .splice_init (chan_id , 100000 , funds_result ['psbt' ])
458
+ result = l3 .rpc .splice_update (chan_id , result ['psbt' ])
459
+ assert (result ['commitments_secured' ] is False )
460
+ result = l3 .rpc .splice_update (chan_id , result ['psbt' ])
461
+ assert (result ['commitments_secured' ] is True )
462
+ result = l3 .rpc .signpsbt (result ['psbt' ])
463
+ result = l3 .rpc .splice_signed (chan_id , result ['signed_psbt' ])
464
+
465
+ wait_for (lambda : only_one (l2 .rpc .listpeerchannels (l3 .info ['id' ])['channels' ])['state' ] == 'CHANNELD_AWAITING_SPLICE' )
466
+ bitcoind .generate_block (6 , wait_for_mempool = 1 )
467
+ wait_for (lambda : only_one (l2 .rpc .listpeerchannels (l3 .info ['id' ])['channels' ])['state' ] == 'CHANNELD_NORMAL' )
468
+
469
+ # Now restart l2, make sure it remembers the original!
470
+ l2 .restart ()
471
+ l2 .rpc .connect (l1 .info ['id' ], 'localhost' , l1 .port )
472
+ l2 .rpc .connect (l3 .info ['id' ], 'localhost' , l3 .port )
473
+
474
+ wait_for (lambda : only_one (l1 .rpc .listpeers ()['peers' ])['connected' ] is True )
475
+ l1 .rpc .sendpay (route , inv2 ['payment_hash' ], payment_secret = inv2 ['payment_secret' ])
476
+ l1 .rpc .waitsendpay (inv2 ['payment_hash' ])
0 commit comments