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:
+2
-2
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user