use bitcoin::blockdata::script::{Script,Builder};
use bitcoin::blockdata::transaction::{TxIn, TxOut, Transaction, SigHashType};
use bitcoin::blockdata::opcodes;
-use bitcoin::util::uint::Uint256;
use bitcoin::util::hash::{Sha256dHash, Hash160};
use bitcoin::util::bip143;
use bitcoin::network::serialize::BitcoinHash;
pub struct Channel {
user_id: u64,
- channel_id: Uint256,
+ channel_id: [u8; 32],
channel_state: u32,
channel_outbound: bool,
secp_ctx: Secp256k1,
Channel {
user_id: user_id,
- channel_id: rng::rand_uint256(),
+ channel_id: rng::rand_u832(),
channel_state: ChannelState::OurInitSent as u32,
channel_outbound: true,
secp_ctx: secp_ctx,
// Public utilities:
- pub fn channel_id(&self) -> Uint256 {
+ pub fn channel_id(&self) -> [u8; 32] {
self.channel_id
}