X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fonion_message%2Fpacket.rs;h=32feb075b614201fb48bb4927d800d6704214605;hb=38690bf50a60dc7b7ca3fbf67299b9b701607721;hp=deda1acb7e95e86950e951ca040003e14f79d4dd;hpb=d1ac0717fe832bc8f439ad75c30dfe2e2012bfb3;p=rust-lightning diff --git a/lightning/src/onion_message/packet.rs b/lightning/src/onion_message/packet.rs index deda1acb..32feb075 100644 --- a/lightning/src/onion_message/packet.rs +++ b/lightning/src/onion_message/packet.rs @@ -135,6 +135,12 @@ impl OnionMessageContents for ParsedOnionMessageContent &ParsedOnionMessageContents::Custom(ref msg) => msg.tlv_type(), } } + fn msg_type(&self) -> &'static str { + match self { + ParsedOnionMessageContents::Offers(ref msg) => msg.msg_type(), + ParsedOnionMessageContents::Custom(ref msg) => msg.msg_type(), + } + } } impl Writeable for ParsedOnionMessageContents { @@ -150,6 +156,9 @@ impl Writeable for ParsedOnionMessageContents { pub trait OnionMessageContents: Writeable + core::fmt::Debug { /// Returns the TLV type identifying the message contents. MUST be >= 64. fn tlv_type(&self) -> u64; + + /// Returns the message type + fn msg_type(&self) -> &'static str; } /// Forward control TLVs in their blinded and unblinded form.