Allow sending onion messages to 1-hop blinded path
[rust-lightning] / lightning / src / onion_message / messenger.rs
index d526ba9e3a2dfb1c226a7cdf5adef4276d69e24f..e50d3d67e4505d2dd784fc45500ece57e59b7fb8 100644 (file)
@@ -225,8 +225,8 @@ pub enum SendError {
        /// Because implementations such as Eclair will drop onion messages where the message packet
        /// exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
        TooBigPacket,
-       /// The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
-       /// blinded hops.
+       /// The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
+       /// hops.
        TooFewBlindedHops,
        /// Our next-hop peer was offline or does not support onion message forwarding.
        InvalidFirstHop,
@@ -299,7 +299,7 @@ where
 {
        let OnionMessagePath { intermediate_nodes, mut destination } = path;
        if let Destination::BlindedPath(BlindedPath { ref blinded_hops, .. }) = destination {
-               if blinded_hops.len() < 2 {
+               if blinded_hops.is_empty() {
                        return Err(SendError::TooFewBlindedHops);
                }
        }