]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/package/class_PackageRecipientDiscovery.php
Code cleanups and project continued:
[hub.git] / application / hub / main / discovery / package / class_PackageRecipientDiscovery.php
index d7a5c0e4c760e155aab02c1f47fe17b08545d438..7ddff1fb664129fa0b9588dbb93d09e332f414a6 100644 (file)
@@ -71,14 +71,8 @@ class PackageRecipientDiscovery extends BaseHubDiscovery implements Discoverable
 
                        // The target 'self' is always the external IP address!
                        case NetworkPackage::NETWORK_TARGET_SELF:
-                               // Is the external_ip config entry set?
-                               if ($this->getConfigInstance()->getConfigEntry('external_ip') != '') {
-                                       // Use it as external ip
-                                       $ip = $this->getConfigInstance()->getConfigEntry('external_ip');
-                               } else {
-                                       // Determine own external ip by connecting to my (coder) server at 188.138.90.169
-                                       $ip = ConsoleTools::determineExternalIp();
-                               }
+                               // Determine IP or 'external_ip' if set
+                               $ip = HubTools::determineOwnExternalIp();
 
                                // Get port and add it
                                $ipPort = $ip . ':' . $this->getConfigInstance()->getConfigEntry('node_' . $this->determineProtocolByPackageData($packageData) . '_listen_port');