@ -38,20 +38,15 @@ func GetSyncingPort(nodePort string) string {
// getNeighborPeers is a helper function to return list of peers
// getNeighborPeers is a helper function to return list of peers
// based on different neightbor map
// based on different neightbor map
func ( node * Node ) getNeighborPeers ( neighbor * sync . Map ) [ ] p2p . Peer {
func ( node * Node ) getNeighborPeers ( neighbor * sync . Map ) [ ] p2p . Peer {
res := [ ] p2p . Peer { }
tmp := [ ] p2p . Peer { }
tmp := [ ] p2p . Peer { }
neighbor . Range ( func ( k , v interface { } ) bool {
neighbor . Range ( func ( k , v interface { } ) bool {
tmp = append ( tmp , v . ( p2p . Peer ) )
p := v . ( p2p . Peer )
t := p . Port
p . Port = GetSyncingPort ( t )
tmp = append ( tmp , p )
return true
return true
} )
} )
for _ , peer := range tmp {
return tmp
port := GetSyncingPort ( peer . Port )
if peer . Port != node . SelfPeer . Port && port != "" {
peer . Port = port
res = append ( res , peer )
}
}
return res
}
}
// GetBeaconSyncingPeers returns a list of peers for beaconchain syncing
// GetBeaconSyncingPeers returns a list of peers for beaconchain syncing