Compact a BlindedPath's introduction node
[rust-lightning] / lightning / src / onion_message / messenger.rs
index 5493b267ed9527e8b0b6de2db0b7ee532ed7cb20..fc3eead1e4fac6a53e16f165ea39e7ff2f129710 100644 (file)
@@ -445,7 +445,7 @@ where
                        .take(MAX_PATHS)
                        .collect::<Result<Vec<_>, _>>();
 
-               match paths {
+               let mut paths = match paths {
                        Ok(paths) if !paths.is_empty() => Ok(paths),
                        _ => {
                                if is_recipient_announced {
@@ -455,7 +455,12 @@ where
                                        Err(())
                                }
                        },
+               }?;
+               for path in &mut paths {
+                       path.use_compact_introduction_node(&network_graph);
                }
+
+               Ok(paths)
        }
 }