File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,20 +163,14 @@ pub unsafe extern "C" fn dash_spv_ffi_config_add_peer(
163163 }
164164 } ;
165165
166- // 1) Try parsing as full SocketAddr first (handles IPv6 [::1]:port forms)
167- if let Ok ( sock) = addr_str. parse :: < SocketAddr > ( ) {
168- cfg. peers . push ( sock) ;
169- return FFIErrorCode :: Success as i32 ;
170- }
171-
172- // 2) If that fails, try parsing as bare IP address and apply default port
166+ // Try parsing as bare IP address and apply default port
173167 if let Ok ( ip) = addr_str. parse :: < IpAddr > ( ) {
174168 let sock = SocketAddr :: new ( ip, default_port) ;
175169 cfg. peers . push ( sock) ;
176170 return FFIErrorCode :: Success as i32 ;
177171 }
178172
179- // 3) Must be a hostname - reject empty or missing hostname
173+ // If not, must be a hostname - reject empty or missing hostname
180174 if addr_str. is_empty ( ) || addr_str. starts_with ( ':' ) {
181175 set_last_error ( "Empty or missing hostname" ) ;
182176 return FFIErrorCode :: InvalidArgument as i32 ;
You can’t perform that action at this time.
0 commit comments