added fixed adding duplicate structs to IP table
This commit is contained in:
@@ -45,13 +45,16 @@ func UpdateIpTableListClient() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// IP addresses to not read from
|
||||
var DoNotRead p2p.IpAddresses
|
||||
// IP addresses to not append to struct due to
|
||||
// duplication
|
||||
|
||||
Addresses, err := p2p.ReadIpTable()
|
||||
DoNotRead := Addresses
|
||||
|
||||
// Run loop 3 times
|
||||
for i := 0; i < 3; i++ {
|
||||
// Gets information from IP table
|
||||
Addresses, err := p2p.ReadIpTable()
|
||||
Addresses, err = p2p.ReadIpTable()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
BIN
p2p-rendering-computation
Executable file
BIN
p2p-rendering-computation
Executable file
Binary file not shown.
@@ -1,7 +1,5 @@
|
||||
package p2p
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Runs a speed test and does updates IP tables accordingly
|
||||
func (ip *IpAddresses)SpeedTest() error{
|
||||
|
||||
@@ -25,7 +23,6 @@ func (ip *IpAddresses)SpeedTest() error{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(ip.IpAddress[i].Latency)
|
||||
}
|
||||
|
||||
err := ip.WriteIpTable()
|
||||
@@ -43,7 +40,9 @@ func (ip *IpAddresses)SpeedTestUpdatedIPTable() error{
|
||||
return err
|
||||
}
|
||||
|
||||
var DoNotRead IpAddresses
|
||||
// To ensure struct has no duplicates IP addresses
|
||||
DoNotRead := targets
|
||||
|
||||
// Appends all IP addresses
|
||||
for i, _ := range targets.IpAddress {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user