Skip to content

Commit 733e562

Browse files
f allow sending any custom OM, not just those understood by the handler
TODO do we want to allow this? it makes the call signature nicer and adds flexibility
1 parent 9d5fa44 commit 733e562

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/onion_message/messenger.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<Signer: Sign, K: Deref, L: Deref, CMH: Deref> OnionMessenger<Signer, K, L,
167167

168168
/// Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
169169
/// See [`OnionMessenger`] for example usage.
170-
pub fn send_onion_message(&self, intermediate_nodes: &[PublicKey], destination: Destination, message: Message<<<CMH as Deref>::Target as CustomOnionMessageHandler>::CustomMessage>, reply_path: Option<BlindedRoute>) -> Result<(), SendError> {
170+
pub fn send_onion_message<T: OnionMessageContents>(&self, intermediate_nodes: &[PublicKey], destination: Destination, message: Message<T>, reply_path: Option<BlindedRoute>) -> Result<(), SendError> {
171171
if let Destination::BlindedRoute(BlindedRoute { ref blinded_hops, .. }) = destination {
172172
if blinded_hops.len() < 2 {
173173
return Err(SendError::TooFewBlindedHops);

0 commit comments

Comments
 (0)