]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 22 Feb 2024 23:38:57 +0000 (00:38 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 22 Feb 2024 23:38:57 +0000 (00:38 +0100)
- more pre-checks to avoid exceptions
- don't abuse catching them here as a control statement (if)

fba/commands.py

index 0e65f6eef41213d771b4d87cfe7484c2b1f0f287..66c36c6f4178bb9066053c1275ffca4634402897 100644 (file)
@@ -1542,7 +1542,19 @@ def update_nodeinfo(args: argparse.Namespace) -> int:
     cnt = 0
     for row in domains:
         logger.debug("row[]='%s'", type(row))
-        if blacklist.is_blacklisted(row["domain"]):
+        if row["domain"].endswith(".i2p") and not config.get("allow_i2p_domain"):
+            logger.debug("row[domain]='%s' is an I2P address - SKIPPED", row["domain"])
+            continue
+        elif row["domain"].endswith(".onion"):
+            logger.debug("row[domain]='%s' is a TOR .onion domain - SKIPPED", row["domain"])
+            continue
+        elif row["domain"].endswith(".arpa"):
+            logger.debug("row[domain]='%s' is a reverse IP address - SKIPPED", row["domain"])
+            continue
+        elif row["domain"].endswith(".tld"):
+            logger.debug("row[domain]='%s' is a fake domain - SKIPPED", row["domain"])
+            continue
+        elif blacklist.is_blacklisted(row["domain"]):
             logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"])
             continue
         elif not args.force and instances.is_recent(row["domain"], "last_nodeinfo"):