Add unknown message handler to peer manager
[rust-lightning] / lightning / src / util / events.rs
index 1bdbff0333a520e0aced1526272d64bb94e75c40..122b2efc1e6f4f8d33926898e6cf48c936163844 100644 (file)
@@ -160,7 +160,6 @@ impl Writeable for Event {
                                write_tlv_fields!(writer, {
                                        (0, payment_preimage, required),
                                });
-                               payment_preimage.write(writer)?;
                        },
                        &Event::PaymentFailed { ref payment_hash, ref rejected_by_dest,
                                #[cfg(test)]
@@ -390,6 +389,15 @@ pub enum MessageSendEvent {
                /// The channel_update which should be sent.
                msg: msgs::ChannelUpdate,
        },
+       /// Used to indicate that a channel_update should be sent to a single peer.
+       /// In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
+       /// private channel and we shouldn't be informing all of our peers of channel parameters.
+       SendChannelUpdate {
+               /// The node_id of the node which should receive this message
+               node_id: PublicKey,
+               /// The channel_update which should be sent.
+               msg: msgs::ChannelUpdate,
+       },
        /// Broadcast an error downstream to be handled
        HandleError {
                /// The node_id of the node which should receive this message
@@ -425,7 +433,7 @@ pub enum MessageSendEvent {
                node_id: PublicKey,
                /// The reply_channel_range which should be sent.
                msg: msgs::ReplyChannelRange,
-       }
+       },
 }
 
 /// A trait indicating an object may generate message send events