]> git.bitcoin.ninja Git - rust-lightning/commitdiff
change temp_channel from deserialise to copy
authorSW van Heerden <swvheerden@gmail.com>
Thu, 6 Sep 2018 13:34:33 +0000 (15:34 +0200)
committerMatt Corallo <git@bluematt.me>
Thu, 6 Sep 2018 14:49:36 +0000 (10:49 -0400)
src/ln/msgs.rs

index 034a580c018aa727e50d29292aaea8d9e5bca4e5..1d0ea1c637235c02774fe3e111238c6a25ed15d4 100644 (file)
@@ -681,10 +681,11 @@ impl MsgDecodable for OpenChannel {
                        }
                        shutdown_scriptpubkey = Some(Script::from(v[321..321+len].to_vec()));
                }
-
+               let mut temp_channel_id = [0; 32];
+               temp_channel_id[..].copy_from_slice(&v[32..64]);
                Ok(OpenChannel {
                        chain_hash: deserialize(&v[0..32]).unwrap(),
-                       temporary_channel_id: deserialize(&v[32..64]).unwrap(),
+                       temporary_channel_id: temp_channel_id,
                        funding_satoshis: byte_utils::slice_to_be64(&v[64..72]),
                        push_msat: byte_utils::slice_to_be64(&v[72..80]),
                        dust_limit_satoshis: byte_utils::slice_to_be64(&v[80..88]),