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

Function _chan_id

tests/test_db.py:319–323  ·  view source on GitHub ↗
(txid, outnum)

Source from the content-addressed store, hash-verified

317 results = l2.db_query('SELECT hex(full_channel_id) AS cid, hex(funding_tx_id) as txid, funding_tx_outnum FROM channels')
318
319 def _chan_id(txid, outnum):
320 chanid = bytearray.fromhex(txid)
321 chanid[-1] ^= outnum % 256
322 chanid[-2] ^= outnum // 256
323 return chanid.hex()
324
325 for row in results:
326 assert _chan_id(row['txid'], row['funding_tx_outnum']) == row['cid'].lower()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected