diff --git a/p2p/ip_table.json b/p2p/ip_table.json index fc12812..bb16a07 100644 --- a/p2p/ip_table.json +++ b/p2p/ip_table.json @@ -2,9 +2,21 @@ "ip_address": [ { "ipv4": "145.40.90.151", - "latency": 139109233, - "download": 6.383175565123993, - "upload": 896786.5894533413 + "latency": 136977360, + "download": 6.439557936207414, + "upload": 1247166.5933956294 + }, + { + "ipv4": "86.99.70.106", + "latency": 8933343, + "download": 201730.13853312942, + "upload": 2203225.5221644486 + }, + { + "ipv4": "86.99.70.106", + "latency": 0, + "download": 0, + "upload": 0 } ] } \ No newline at end of file diff --git a/p2p/speedtest.go b/p2p/speedtest.go index 94c3611..090d940 100644 --- a/p2p/speedtest.go +++ b/p2p/speedtest.go @@ -64,14 +64,15 @@ func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{ } // To ensure struct has no duplicates IP addresses - DoNotRead := targets + //DoNotRead := targets // Appends all IP addresses for i, _ := range targets.IpAddress { + // To ensure that there are no duplicate IP addresses Exists := false - for k := range DoNotRead.IpAddress { - if DoNotRead.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 { + for k := range ip.IpAddress { + if ip.IpAddress[k].Ipv4 == targets.IpAddress[i].Ipv4 { Exists = true break }