File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1102,13 +1102,12 @@ async fn start_ldk() {
11021102 let id = NodeId :: from_pubkey ( & node_id) ;
11031103 let addrs = if let Some ( node) = graph_connect. read_only ( ) . node ( & id) {
11041104 if let Some ( ann) = & node. announcement_info {
1105- ann. addresses ( ) . iter ( ) . filter_map ( |addr| {
1106- match addr {
1107- lightning:: ln:: msgs:: SocketAddress :: OnionV2 ( _) => None ,
1108- lightning:: ln:: msgs:: SocketAddress :: OnionV3 { .. } => None ,
1109- _ => Some ( addr. clone ( ) ) ,
1110- }
1111- } ) . collect :: < Vec < _ > > ( )
1105+ let non_onion = |addr| match addr {
1106+ & lightning:: ln:: msgs:: SocketAddress :: OnionV2 ( _) => None ,
1107+ & lightning:: ln:: msgs:: SocketAddress :: OnionV3 { .. } => None ,
1108+ _ => Some ( addr. clone ( ) ) ,
1109+ } ;
1110+ ann. addresses ( ) . iter ( ) . filter_map ( non_onion) . collect :: < Vec < _ > > ( )
11121111 } else {
11131112 Vec :: new ( )
11141113 }
@@ -1117,7 +1116,9 @@ async fn start_ldk() {
11171116 } ;
11181117 for addr in addrs {
11191118 let sockaddrs = addr. to_socket_addrs ( ) ;
1120- if sockaddrs. is_err ( ) { continue ; }
1119+ if sockaddrs. is_err ( ) {
1120+ continue ;
1121+ }
11211122 for sockaddr in sockaddrs. unwrap ( ) {
11221123 let _ =
11231124 cli:: do_connect_peer ( node_id, sockaddr, Arc :: clone ( & connect_pm) ) . await ;
You can’t perform that action at this time.
0 commit comments