We should process an update inside a temporary_channel_failure
(node_factory)
| 1243 | |
| 1244 | |
| 1245 | def test_xpay_get_error_with_update(node_factory): |
| 1246 | """We should process an update inside a temporary_channel_failure""" |
| 1247 | l1, l2, l3 = node_factory.line_graph(3, opts={'log-level': 'io'}, fundchannel=True, wait_for_announce=True) |
| 1248 | chanid2 = l2.get_channel_scid(l3) |
| 1249 | |
| 1250 | inv = l3.rpc.invoice(123000, 'test_xpay_get_error_with_update', 'description') |
| 1251 | |
| 1252 | # Make sure it's not doing startup any more (where it doesn't disable channels!) |
| 1253 | l2.daemon.wait_for_log("channel_gossip: no longer in startup mode", timeout=70) |
| 1254 | |
| 1255 | # Make sure l2 doesn't tell l1 directly that channel is disabled. |
| 1256 | l2.rpc.dev_suppress_gossip() |
| 1257 | l3.stop() |
| 1258 | |
| 1259 | # Make sure that l2 has seen disconnect, considers channel disabled. |
| 1260 | wait_for(lambda: only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['peer_connected'] is False) |
| 1261 | |
| 1262 | assert(l1.is_channel_active(chanid2)) |
| 1263 | |
| 1264 | with pytest.raises(RpcError, match=r'temporary_channel_failure'): |
| 1265 | l1.rpc.xpay(inv['bolt11']) |
| 1266 | |
| 1267 | # Make sure we get an onionreply, without the type prefix of the nested |
| 1268 | # channel_update, and it should patch it to include a type prefix. The |
| 1269 | # prefix 0x0102 should be in the channel_update, but not in the |
| 1270 | # onionreply (negation of 0x0102 in the RE) |
| 1271 | l1.daemon.wait_for_log(rf'Got channel_update from error for {chanid2}/0: 0102') |
| 1272 | |
| 1273 | # But this update is only for this one, not future ones! |
| 1274 | time.sleep(5) |
| 1275 | assert l1.is_channel_active(chanid2) |
| 1276 | |
| 1277 | |
| 1278 | def test_xpay_error_update_fees(node_factory): |
nothing calls this directly
no test coverage detected