From f5e3a3ea8155e1ab125819670fcf0df5366ab8c5 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Thu, 6 Sep 2018 15:34:33 +0200 Subject: [PATCH] change temp_channel from deserialise to copy --- src/ln/msgs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index 034a580c0..1d0ea1c63 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -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]), -- 2.39.5