From ed96eb78a133836ded3287a1a1f83196d8057a00 Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Wed, 10 Aug 2022 19:09:28 -0600 Subject: [PATCH] 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 --- scripts/sync.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/sync.js b/scripts/sync.js index 05909a0..eb55f95 100644 --- a/scripts/sync.js +++ b/scripts/sync.js @@ -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); }); }