Simplify + clarify random-bytes-fetching from KeysInterface
[rust-lightning] / lightning / src / ln / channel.rs
index 2bea55a57bc404a51d7ad20d3b2f0d1e2454cd9d..6079c47ee870e8d0d2e74e9d72cd27a31e074b6f 100644 (file)
@@ -491,7 +491,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
                        user_id: user_id,
                        config: config.channel_options.clone(),
 
-                       channel_id: keys_provider.get_channel_id(),
+                       channel_id: keys_provider.get_secure_random_bytes(),
                        channel_state: ChannelState::OurInitSent as u32,
                        channel_outbound: true,
                        secp_ctx: Secp256k1::new(),
@@ -4555,8 +4555,7 @@ mod tests {
                fn get_channel_keys(&self, _inbound: bool, _channel_value_satoshis: u64) -> InMemoryChannelKeys {
                        self.chan_keys.clone()
                }
-               fn get_onion_rand(&self) -> (SecretKey, [u8; 32]) { panic!(); }
-               fn get_channel_id(&self) -> [u8; 32] { [0; 32] }
+               fn get_secure_random_bytes(&self) -> [u8; 32] { [0; 32] }
        }
 
        fn public_from_secret_hex(secp_ctx: &Secp256k1<All>, hex: &str) -> PublicKey {