projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement ResponseInstruction Usage in OnionMessage Handling
[rust-lightning]
/
lightning
/
src
/
onion_message
/
packet.rs
diff --git
a/lightning/src/onion_message/packet.rs
b/lightning/src/onion_message/packet.rs
index 510f0ea025a0d615b0f54292d865602ac7e103a6..bbf04ca3ef4baa3f9e27562f073941e254a482d4 100644
(file)
--- a/
lightning/src/onion_message/packet.rs
+++ b/
lightning/src/onion_message/packet.rs
@@
-135,6
+135,12
@@
impl<T: OnionMessageContents> OnionMessageContents for ParsedOnionMessageContent
&ParsedOnionMessageContents::Custom(ref msg) => msg.tlv_type(),
}
}
&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<T: OnionMessageContents> Writeable for ParsedOnionMessageContents<T> {
}
impl<T: OnionMessageContents> Writeable for ParsedOnionMessageContents<T> {
@@
-150,6
+156,9
@@
impl<T: OnionMessageContents> Writeable for ParsedOnionMessageContents<T> {
pub trait OnionMessageContents: Writeable + core::fmt::Debug {
/// Returns the TLV type identifying the message contents. MUST be >= 64.
fn tlv_type(&self) -> u64;
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.
}
/// Forward control TLVs in their blinded and unblinded form.