From 09639181ba24c734826e4b43b574d3002455a856 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 24 May 2021 00:53:13 +0200 Subject: [PATCH] FeatherNode: add regex for local node detection --- src/utils/nodes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/nodes.h b/src/utils/nodes.h index 8d38cfd..66b79f8 100644 --- a/src/utils/nodes.h +++ b/src/utils/nodes.h @@ -74,7 +74,8 @@ struct FeatherNode { } bool isLocal() const { - return (url.host() == "127.0.0.1" || url.host() == "localhost"); + QRegularExpression localNetwork(R"((^127\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.))"); + return (localNetwork.match(url.host()).hasMatch() || url.host() == "localhost"); } bool isOnion() const {