Test bug where trying to pay an invoice from an *offline* node which gives a routehint straight to us causes an issue
(node_factory, bitcoind)
| 5192 | |
| 5193 | |
| 5194 | def test_routehint_tous(node_factory, bitcoind): |
| 5195 | """ |
| 5196 | Test bug where trying to pay an invoice from an *offline* node which |
| 5197 | gives a routehint straight to us causes an issue |
| 5198 | """ |
| 5199 | |
| 5200 | # Existence of l1 makes l3 use l2 for routehint (otherwise it sees deadend) |
| 5201 | l1, l2 = node_factory.line_graph(2, wait_for_announce=True) |
| 5202 | scid12 = first_scid(l1, l2) |
| 5203 | l3 = node_factory.get_node() |
| 5204 | l3.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 5205 | scid23, _ = l2.fundchannel(l3, 1000000, announce_channel=False) |
| 5206 | # Make sure l3 sees l1->l2 channel. |
| 5207 | l3.wait_channel_active(scid12) |
| 5208 | |
| 5209 | inv = l3.rpc.invoice(10, "test", "test")['bolt11'] |
| 5210 | decoded = l3.rpc.decode(inv) |
| 5211 | assert(only_one(only_one(decoded['routes']))['short_channel_id'] |
| 5212 | == only_one(l3.rpc.listpeerchannels()['channels'])['alias']['remote']) |
| 5213 | |
| 5214 | l3.stop() |
| 5215 | with pytest.raises(RpcError, match=r'Failed: We could not find a usable set of paths. All 1 channels to the destination are disabled.'): |
| 5216 | l2.rpc.xpay(inv) |
| 5217 | |
| 5218 | |
| 5219 | def test_setchannel_enforcement_delay(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected