Send announcement_signatures msgs out-of-band for ordered delivery
[rust-lightning] / src / ln / msgs.rs
index b5db51cf2bb4a200c58e6e03c0bf52a65626b54c..d01595b72164bfe09917144f2bf47c54a0c1809b 100644 (file)
@@ -168,6 +168,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],
@@ -191,6 +192,7 @@ pub struct OpenChannel {
 }
 
 /// An accept_channel message to be sent or received from a peer
+#[derive(Clone)]
 pub struct AcceptChannel {
        pub(crate) temporary_channel_id: [u8; 32],
        pub(crate) dust_limit_satoshis: u64,
@@ -210,6 +212,7 @@ pub struct AcceptChannel {
 }
 
 /// A funding_created message to be sent or received from a peer
+#[derive(Clone)]
 pub struct FundingCreated {
        pub(crate) temporary_channel_id: [u8; 32],
        pub(crate) funding_txid: Sha256dHash,
@@ -218,6 +221,7 @@ pub struct FundingCreated {
 }
 
 /// A funding_signed message to be sent or received from a peer
+#[derive(Clone)]
 pub struct FundingSigned {
        pub(crate) channel_id: [u8; 32],
        pub(crate) signature: Signature,
@@ -521,18 +525,18 @@ pub enum RAACommitmentOrder {
 ///
 /// 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 {
+pub trait ChannelMessageHandler : events::MessageSendEventsProvider + Send + Sync {
        //Channel init:
        /// Handle an incoming open_channel message from the given peer.
-       fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &OpenChannel) -> Result<AcceptChannel, HandleError>;
+       fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &OpenChannel) -> Result<(), HandleError>;
        /// Handle an incoming accept_channel message from the given peer.
        fn handle_accept_channel(&self, their_node_id: &PublicKey, msg: &AcceptChannel) -> Result<(), HandleError>;
        /// Handle an incoming funding_created message from the given peer.
-       fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &FundingCreated) -> Result<FundingSigned, HandleError>;
+       fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &FundingCreated) -> Result<(), HandleError>;
        /// Handle an incoming funding_signed message from the given peer.
        fn handle_funding_signed(&self, their_node_id: &PublicKey, msg: &FundingSigned) -> Result<(), HandleError>;
        /// Handle an incoming funding_locked message from the given peer.
-       fn handle_funding_locked(&self, their_node_id: &PublicKey, msg: &FundingLocked) -> Result<Option<AnnouncementSignatures>, HandleError>;
+       fn handle_funding_locked(&self, their_node_id: &PublicKey, msg: &FundingLocked) -> Result<(), HandleError>;
 
        // Channl close:
        /// Handle an incoming shutdown message from the given peer.