diff --git a/lib/explorer.js b/lib/explorer.js index fbec3a0..35e48dd 100644 --- a/lib/explorer.js +++ b/lib/explorer.js @@ -975,7 +975,7 @@ module.exports = { }, get_geo_location: function(address, cb) { - request({uri: 'https://freegeoip.app/json/' + address, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, geo) { + request({uri: 'https://reallyfreegeoip.org/json/' + address, json: true, headers: {'User-Agent': 'eiquidus'}}, function (error, response, geo) { return cb(error, geo); }); }, diff --git a/scripts/sync.js b/scripts/sync.js index 5f0acb3..f1fbca4 100644 --- a/scripts/sync.js +++ b/scripts/sync.js @@ -458,6 +458,9 @@ if (lib.is_locked([database]) == false) { if (error) { console.log(error); exit(1); + } else if (geo == null || typeof geo != 'object') { + console.log('Error: geolocation api did not return a valid object'); + exit(1); } else { // add peer to collection db.create_peer({