X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fonion_message%2Fmessenger.rs;h=a09c942be61fbfcb75da606e6b440bfffa37bdbc;hb=24b63de10c6b951263e7d262e739c55e01e650b3;hp=a80715e16f092362473b16b7dd1fb5fb5d251346;hpb=150c87a089fedb69510498f28d5181eca1562d49;p=rust-lightning diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index a80715e1..a09c942b 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -154,6 +154,15 @@ pub enum SendError { InvalidMessage, /// Our next-hop peer's buffer was full or our total outbound buffer was full. BufferFull, + /// Failed to retrieve our node id from the provided [`KeysInterface`]. + /// + /// [`KeysInterface`]: crate::chain::keysinterface::KeysInterface + GetNodeIdFailed, + /// We attempted to send to a blinded route where we are the introduction node, and failed to + /// advance the blinded route to make the second hop the new introduction node. Either + /// [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the + /// new blinding point, or we were attempting to send to ourselves. + BlindedRouteAdvanceFailed, } /// Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`], @@ -198,7 +207,7 @@ impl OnionMessenger(&self, intermediate_nodes: &[PublicKey], destination: Destination, message: OnionMessageContents, reply_path: Option) -> Result<(), SendError> { + pub fn send_onion_message(&self, intermediate_nodes: &[PublicKey], mut destination: Destination, message: OnionMessageContents, reply_path: Option) -> Result<(), SendError> { if let Destination::BlindedRoute(BlindedRoute { ref blinded_hops, .. }) = destination { if blinded_hops.len() < 2 { return Err(SendError::TooFewBlindedHops); @@ -207,6 +216,19 @@ impl OnionMessenger