Fix getting coordinates
This commit is contained in:
parent
b5650cdbf8
commit
d8f2920ac2
3 changed files with 3 additions and 3 deletions
|
@ -77,7 +77,7 @@ public class BlockchainNodeFinderThread implements Runnable{
|
|||
Node existingNode = API.NODES.get(node.getKey());
|
||||
if(existingNode==null){
|
||||
JSONObject geoData = GeoIP.getCachedGeoIPInformation(node.getKey());
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation(geoData.has("loc")?geoData.getString("loc"):null);
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation((geoData!=null && geoData.has("loc"))?geoData.getString("loc"):null);
|
||||
existingNode = new Node(node.getKey(),coords[0],coords[1]);
|
||||
API.NODES.put(node.getKey(),existingNode);
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ public class DHTNodeFinderThread implements Runnable{
|
|||
Node existingNode = API.NODES.get(receiverPacket.getAddress());
|
||||
if(existingNode==null){
|
||||
JSONObject geoData = GeoIP.getCachedGeoIPInformation(receiverPacket.getAddress());
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation(geoData.has("loc")?geoData.getString("loc"):null);
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation((geoData!=null && geoData.has("loc"))?geoData.getString("loc"):null);
|
||||
existingNode = new Node(receiverPacket.getAddress(),coords[0],coords[1]);
|
||||
API.NODES.put(receiverPacket.getAddress(),existingNode);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ public class HubNodeFinderThread implements Runnable{
|
|||
Node existingNode = API.NODES.get(entry.getKey());
|
||||
if(existingNode==null){
|
||||
JSONObject geoData = GeoIP.getCachedGeoIPInformation(entry.getKey());
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation(geoData.has("loc")?geoData.getString("loc"):null);
|
||||
Double[] coords = GeoIP.getCoordinateFromLocation((geoData!=null && geoData.has("loc"))?geoData.getString("loc"):null);
|
||||
existingNode = new Node(entry.getKey(),coords[0],coords[1]);
|
||||
API.NODES.put(entry.getKey(),existingNode);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue