X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fmsgs.rs;h=5b3d57aae0273c90aad5c4c990a1019e818e9bab;hb=41f1e1680553d1416d1b2bc2e4fb284cbe1a130f;hp=f87e3722f999d239934241e8aa5ee046872d8fd8;hpb=92ff499bdbc115fbb897e5aa8bf758fc66987e95;p=rust-lightning diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index f87e3722..5b3d57aa 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -1,9 +1,11 @@ //! Wire messages, traits representing wire message handlers, and a few error types live here. +//! //! For a normal node you probably don't need to use anything here, however, if you wish to split a //! node into an internet-facing route/message socket handling daemon and a separate daemon (or //! server entirely) which handles only channel-related messages you may wish to implement //! ChannelMessageHandler yourself and use it to re-serialize messages and pass them across //! daemons/servers. +//! //! Note that if you go with such an architecture (instead of passing raw socket events to a //! non-internet-facing system) you trust the frontend internet-facing system to not lie about the //! source node_id of the mssage, however this does allow you to significantly reduce bandwidth @@ -222,6 +224,7 @@ pub struct FundingSigned { } /// A funding_locked message to be sent or received from a peer +#[derive(Clone)] pub struct FundingLocked { pub(crate) channel_id: [u8; 32], pub(crate) next_per_commitment_point: PublicKey, @@ -465,6 +468,7 @@ pub struct CommitmentUpdate { pub(crate) update_fulfill_htlcs: Vec, pub(crate) update_fail_htlcs: Vec, pub(crate) update_fail_malformed_htlcs: Vec, + pub(crate) update_fee: Option, pub(crate) commitment_signed: CommitmentSigned, } @@ -484,9 +488,10 @@ pub enum HTLCFailChannelUpdate { }, } -/// A trait to describe an object which can receive channel messages. Messages MAY be called in -/// parallel when they originate from different their_node_ids, however they MUST NOT be called in -/// parallel when the two calls have the same their_node_id. +/// A trait to describe an object which can receive channel messages. +/// +/// Messages MAY be called in parallel when they originate from different their_node_ids, however +/// they MUST NOT be called in parallel when the two calls have the same their_node_id. pub trait ChannelMessageHandler : events::EventsProvider + Send + Sync { //Channel init: /// Handle an incoming open_channel message from the given peer.