Fix peer sync for addresses without country data

-Removed the check for country and country_code since not all ip addresses have country information and can cause a peer drop loop as a result
-Updated the error msg text when port data is not found for existing peers
This commit is contained in:
Joe Uhren
2022-08-10 19:09:28 -06:00
parent dbe0238587
commit ed96eb78a1
+2 -2
View File
@@ -594,9 +594,9 @@ if (lib.is_locked([database]) == false) {
db.find_peer(address, port, function(peer) {
if (peer) {
if ((peer['port'] != null && (isNaN(peer['port']) || peer['port'].length < 2)) || peer['country'].length < 1 || peer['country_code'].length < 1) {
if (peer['port'] != null && (isNaN(peer['port']) || peer['port'].length < 2)) {
db.drop_peers(function() {
console.log('Saved peers missing ports or country, dropping peers. Re-run this script afterwards.');
console.log('Removing peers due to missing port information. Re-run this script to add peers again.');
exit(1);
});
}