X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fmsgs.rs;h=62c4bb0d288512605a7a9487658fe52c4cfa9927;hb=4d77e9d75216d84795bfbaf6a9b41f94637fac1c;hp=7b0254bddfd5fbb470cb9e4e6ee3ba8b1162cc52;hpb=270d1bd00636942fcf359b4abdc5681ebe15307d;p=rust-lightning diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index 7b0254bd..62c4bb0d 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -16,7 +16,7 @@ //! track the network on the less-secure system. use secp256k1::key::PublicKey; -use secp256k1::{Secp256k1, Signature}; +use secp256k1::Signature; use secp256k1; use bitcoin::util::hash::Sha256dHash; use bitcoin::blockdata::script::Script; @@ -26,9 +26,11 @@ use std::{cmp, fmt}; use std::io::Read; use std::result::Result; -use util::{byte_utils, events}; +use util::events; use util::ser::{Readable, Writeable, Writer}; +use ln::channelmanager::{PaymentPreimage, PaymentHash}; + /// An error in decoding a message or struct. #[derive(Debug)] pub enum DecodeError { @@ -45,7 +47,6 @@ pub enum DecodeError { /// node_announcement included more than one address of a given type! ExtraAddressesPerType, /// A length descriptor in the packet didn't describe the later data correctly - /// (currently only generated in node_announcement) BadLengthDescriptor, /// Error from std::io Io(::std::io::Error), @@ -151,6 +152,7 @@ pub struct Init { } /// An error message to be sent or received from a peer +#[derive(Clone)] pub struct ErrorMessage { pub(crate) channel_id: [u8; 32], pub(crate) data: String, @@ -168,6 +170,7 @@ pub struct Pong { } /// An open_channel message to be sent or received from a peer +#[derive(Clone)] pub struct OpenChannel { pub(crate) chain_hash: Sha256dHash, pub(crate) temporary_channel_id: [u8; 32], @@ -187,10 +190,11 @@ pub struct OpenChannel { pub(crate) htlc_basepoint: PublicKey, pub(crate) first_per_commitment_point: PublicKey, pub(crate) channel_flags: u8, - pub(crate) shutdown_scriptpubkey: Option