- pub fn to_channel_id(&self) -> [u8; 32] {
- let mut res = [0; 32];
- res[..].copy_from_slice(&self.txid[..]);
- res[30] ^= ((self.index >> 8) & 0xff) as u8;
- res[31] ^= ((self.index >> 0) & 0xff) as u8;
- res
+ pub fn to_channel_id(&self) -> ChannelId {
+ ChannelId::v1_from_funding_txid(&self.txid.as_inner(), self.index)