X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmsgs.rs;h=519c56542ba491856329319c9df6bd231ba88ed2;hb=87a0018e3ebf7d47086032d817a9e671c359214e;hp=70bf19f41e0b337dda57b9ca94c02b3b2f8005b8;hpb=cd5a11fe0d56fc6520fe94bad2cb5ea461608442;p=rust-lightning diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 70bf19f4..519c5654 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -56,7 +56,10 @@ pub enum DecodeError { /// An init message to be sent or received from a peer pub struct Init { + #[cfg(not(feature = "fuzztarget"))] pub(crate) features: InitFeatures, + #[cfg(feature = "fuzztarget")] + pub features: InitFeatures, } /// An error message to be sent or received from a peer @@ -139,9 +142,10 @@ pub struct FundingSigned { /// A funding_locked message to be sent or received from a peer #[derive(Clone, PartialEq)] +#[allow(missing_docs)] pub struct FundingLocked { - pub(crate) channel_id: [u8; 32], - pub(crate) next_per_commitment_point: PublicKey, + pub channel_id: [u8; 32], + pub next_per_commitment_point: PublicKey, } /// A shutdown message to be sent or received from a peer @@ -570,7 +574,7 @@ pub trait ChannelMessageHandler : events::MessageSendEventsProvider + Send + Syn fn peer_disconnected(&self, their_node_id: &PublicKey, no_connection_possible: bool); /// Handle a peer reconnecting, possibly generating channel_reestablish message(s). - fn peer_connected(&self, their_node_id: &PublicKey); + fn peer_connected(&self, their_node_id: &PublicKey, msg: &Init); /// Handle an incoming channel_reestablish message from the given peer. fn handle_channel_reestablish(&self, their_node_id: &PublicKey, msg: &ChannelReestablish); @@ -600,6 +604,8 @@ pub trait RoutingMessageHandler : Send + Sync { /// starting at the node *after* the provided publickey and including batch_amount entries. /// If None is provided for starting_point, we start at the first node. fn get_next_node_announcements(&self, starting_point: Option<&PublicKey>, batch_amount: u8) -> Vec; + /// Returns whether a full sync should be requested from a peer. + fn should_request_full_sync(&self, node_id: &PublicKey) -> bool; } pub(crate) struct OnionRealm0HopData {