Make the custom message traits cloneable as they're deep in nested structs
[rust-lightning] / lightning / src / onion_message / packet.rs
index 2fb2407dbdd093bdbe4ae260e31f12fbe4722d8a..4cbb30c0cde5cfa9147736eb685c86e49ffd3539 100644 (file)
@@ -104,7 +104,7 @@ pub(super) enum Payload<T: CustomOnionMessageContents> {
        }
 }
 
-#[derive(Debug)]
+#[derive(Clone, Debug)]
 /// The contents of an onion message. In the context of offers, this would be the invoice, invoice
 /// request, or invoice error.
 pub enum OnionMessageContents<T: CustomOnionMessageContents> {
@@ -137,7 +137,7 @@ impl<T: CustomOnionMessageContents> Writeable for OnionMessageContents<T> {
 }
 
 /// The contents of a custom onion message.
-pub trait CustomOnionMessageContents: Writeable {
+pub trait CustomOnionMessageContents: Writeable + Clone {
        /// Returns the TLV type identifying the message contents. MUST be >= 64.
        fn tlv_type(&self) -> u64;
 }