(peer, label)
| 5386 | peer.db_manip("UPDATE channels SET next_htlc_id=0;") |
| 5387 | |
| 5388 | def reuse_id(peer, label): |
| 5389 | peer.start() |
| 5390 | |
| 5391 | def reestablished(): |
| 5392 | chan = only_one(peer.rpc.listpeerchannels(l2.info['id'])['channels']) |
| 5393 | return any('Reconnected, and reestablished' in s for s in chan['status']) |
| 5394 | wait_for(reestablished) |
| 5395 | |
| 5396 | inv = l2.rpc.invoice(100000, label, 'desc') |
| 5397 | route = [{'amount_msat': 100000, 'id': l2.info['id'], 'delay': 18, |
| 5398 | 'channel': first_scid(peer, l2)}] |
| 5399 | peer.rpc.sendpay(route, inv['payment_hash'], |
| 5400 | payment_secret=inv['payment_secret']) |
| 5401 | line = l2.daemon.wait_for_log(r'{}-.*Bad peer_add_htlc: id 0 but expected 1|Error executing statement'.format(peer.info['id'])) |
| 5402 | assert 'Bad peer_add_htlc' in line |
| 5403 | l2.rpc.getinfo() |
| 5404 | |
| 5405 | # l2's channeld restarts on reconnect, lightningd tells it what to expect. |
| 5406 | rewind(l1) |
no test coverage detected