Add flags for if a channel is pub and funding txo in ChannelDetails
[rust-lightning] / lightning / src / ln / peer_channel_encryptor.rs
index bbc074e0fd82e638549b2dadc7eb0627efe84dbd..d38d5ae6a166814e1c98afc1e5550fa077a6cb43 100644 (file)
@@ -1,3 +1,12 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 use ln::msgs::LightningError;
 use ln::msgs;
 
@@ -86,14 +95,14 @@ impl PeerChannelEncryptor {
 
                PeerChannelEncryptor {
                        their_node_id: Some(their_node_id),
-                       secp_ctx: secp_ctx,
+                       secp_ctx,
                        noise_state: NoiseState::InProgress {
                                state: NoiseStep::PreActOne,
                                directional_state: DirectionalNoiseState::Outbound {
                                        ie: ephemeral_key,
                                },
                                bidirectional_state: BidirectionalNoiseState {
-                                       h: h,
+                                       h,
                                        ck: NOISE_CK,
                                },
                        }
@@ -111,7 +120,7 @@ impl PeerChannelEncryptor {
 
                PeerChannelEncryptor {
                        their_node_id: None,
-                       secp_ctx: secp_ctx,
+                       secp_ctx,
                        noise_state: NoiseState::InProgress {
                                state: NoiseStep::PreActOne,
                                directional_state: DirectionalNoiseState::Inbound {
@@ -120,7 +129,7 @@ impl PeerChannelEncryptor {
                                        temp_k2: None,
                                },
                                bidirectional_state: BidirectionalNoiseState {
-                                       h: h,
+                                       h,
                                        ck: NOISE_CK,
                                },
                        }
@@ -312,10 +321,10 @@ impl PeerChannelEncryptor {
 
                let (sk, rk) = final_hkdf;
                self.noise_state = NoiseState::Finished {
-                       sk: sk,
+                       sk,
                        sn: 0,
                        sck: ck.clone(),
-                       rk: rk,
+                       rk,
                        rn: 0,
                        rck: ck,
                };
@@ -365,10 +374,10 @@ impl PeerChannelEncryptor {
 
                let (rk, sk) = final_hkdf;
                self.noise_state = NoiseState::Finished {
-                       sk: sk,
+                       sk,
                        sn: 0,
                        sck: ck.clone(),
-                       rk: rk,
+                       rk,
                        rn: 0,
                        rck: ck,
                };