correction on ip parsing

This commit is contained in:
aglkm
2026-03-20 03:52:10 +03:00
parent 222ca60362
commit 0e039b0c18
+1 -1
View File
@@ -862,7 +862,7 @@ pub async fn get_reachable_nodes(netstats: Arc<Mutex<NetStats>>) -> Result<(), a
match TcpStream::connect_timeout(&socket_addr, Duration::from_millis(3000)) {
Ok(_) => {
let client = reqwest::Client::new();
if let Some((addr, _port)) = node.address.split_once(':') {
if let Some((addr, _port)) = node.address.rsplit_once(':') {
let ip = addr.trim_matches(|c| c == '[' || c == ']');
//let url = format!("https://api.country.is/{}", ip);
let url = format!("http://ip-api.com/json/{}", ip);