(index, chain_hash)
| 3694 | return CCPrivateKey(index.to_bytes(32, "big")).public_key.format(compressed=True) |
| 3695 | |
| 3696 | def open_channel2(index, chain_hash): |
| 3697 | keys = [pubkey(index * 7 + offset + 1) for offset in range(7)] |
| 3698 | temporary_channel_id = hashlib.sha256(bytes(33) + keys[1]).digest() |
| 3699 | fixed = b"".join([ |
| 3700 | struct.pack(">H", 64), # type: open_channel2 |
| 3701 | chain_hash, |
| 3702 | temporary_channel_id, |
| 3703 | struct.pack(">IIQQQQHHI", 253, 253, 100_000, 546, |
| 3704 | 100_000_000, 0, 6, 30, 0), |
| 3705 | *keys, |
| 3706 | b"\x00", # channel_flags |
| 3707 | ]) |
| 3708 | # opening_tlvs: type 1 channel_type = static_remotekey + anchors. |
| 3709 | return temporary_channel_id, fixed + bytes.fromhex("0103401000") |
| 3710 | |
| 3711 | class SocketConn: |
| 3712 | def __init__(self, host, port): |
no test coverage detected