X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmsgs.rs;h=dc8d9215438e09a4eb505a4106f15083003519bc;hb=b14927968fdce89f4640172f5d3d1c589043c481;hp=779cf152825c19cfbbdd737ae2e307d81815dbe5;hpb=16d0f2ff4a4dd968f30e1fbbf938a332267ddcf2;p=rust-lightning diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 779cf152..dc8d9215 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -24,9 +24,10 @@ //! raw socket events into your non-internet-facing system and then send routing events back to //! track the network on the less-secure system. +use bitcoin::blockdata::constants::ChainHash; use bitcoin::secp256k1::PublicKey; use bitcoin::secp256k1::ecdsa::Signature; -use bitcoin::secp256k1; +use bitcoin::{secp256k1, Witness}; use bitcoin::blockdata::script::Script; use bitcoin::hash_types::{Txid, BlockHash}; @@ -42,7 +43,7 @@ use crate::io_extras::read_to_end; use crate::events::{MessageSendEventsProvider, OnionMessageProvider}; use crate::util::logger; -use crate::util::ser::{LengthReadable, Readable, ReadableArgs, Writeable, Writer, WithoutLength, FixedLengthReader, HighZeroBytesDroppedBigSize, Hostname}; +use crate::util::ser::{LengthReadable, Readable, ReadableArgs, Writeable, Writer, WithoutLength, FixedLengthReader, HighZeroBytesDroppedBigSize, Hostname, TransactionU16LenLimited, BigSize}; use crate::ln::{PaymentPreimage, PaymentHash, PaymentSecret}; @@ -88,6 +89,10 @@ pub enum DecodeError { pub struct Init { /// The relevant features which the sender supports. pub features: InitFeatures, + /// Indicates chains the sender is interested in. + /// + /// If there are no common chains, the connection will be closed. + pub networks: Option>, /// The receipient's network address. /// /// This adds the option to report a remote IP address back to a connecting peer using the init @@ -158,6 +163,8 @@ pub struct Pong { /// An [`open_channel`] message to be sent to or received from a peer. /// +/// Used in V1 channel establishment +/// /// [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message #[derive(Clone, Debug, PartialEq, Eq)] pub struct OpenChannel { @@ -199,8 +206,8 @@ pub struct OpenChannel { pub first_per_commitment_point: PublicKey, /// The channel flags to be used pub channel_flags: u8, - /// Optionally, a request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close - pub shutdown_scriptpubkey: OptionalField