MCPcopy Create free account
hub / github.com/ElementsProject/lightning / reuse_id

Function reuse_id

tests/test_connection.py:5388–5403  ·  view source on GitHub ↗
(peer, label)

Source from the content-addressed store, hash-verified

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)

Callers 1

test_peer_reuses_htlc_idFunction · 0.85

Calls 7

wait_forFunction · 0.90
first_scidFunction · 0.90
sendpayMethod · 0.80
wait_for_logMethod · 0.80
startMethod · 0.45
invoiceMethod · 0.45
getinfoMethod · 0.45

Tested by

no test coverage detected