@@ -25,6 +25,10 @@ def test_layers(node_factory):
2525 assert l2 .rpc .askrene_listlayers () == {'layers' : [expect ]}
2626 assert l2 .rpc .askrene_listlayers ('test_layers2' ) == {'layers' : []}
2727
28+ l2 .rpc .askrene_disable_channel ('test_layers' , "1x2x3" , 0 )
29+ expect ['disabled' ].append ("1x2x3/0" )
30+ assert l2 .rpc .askrene_listlayers ('test_layers' ) == {'layers' : [expect ]}
31+
2832 # Tell it l3 connects to l1!
2933 l2 .rpc .askrene_create_channel ('test_layers' ,
3034 l3 .info ['id' ],
@@ -164,6 +168,17 @@ def test_getroutes(node_factory):
164168 # Set up l1 with this as the gossip_store
165169 l1 = node_factory .get_node (gossip_store_file = gsfile .name )
166170
171+ # Disabling channels makes getroutes fail
172+ l1 .rpc .askrene_disable_channel ("chans_disabled" , "0x1x0" )
173+ l1 .rpc .askrene_disable_channel ("chans_disabled" , "0x2x1" )
174+ l1 .rpc .askrene_disable_channel ("chans_disabled" , "0x2x3" )
175+ with pytest .raises (RpcError , match = "Could not find route" ):
176+ l1 .rpc .getroutes (source = nodemap [0 ],
177+ destination = nodemap [1 ],
178+ amount_msat = 1000 ,
179+ layers = ["chans_disabled" ],
180+ maxfee_msat = 1000 ,
181+ final_cltv = 99 )
167182 # Start easy
168183 assert l1 .rpc .getroutes (source = nodemap [0 ],
169184 destination = nodemap [1 ],
0 commit comments