// Get our port from configuration
$ourPort = $this->getConfigInstance()->readConfig('node_tcp_listen_port');
+ // Extract port
+ $bootPort = substr($this->bootIpPort, -strlen($ourPort), strlen($ourPort));
+
// Is the port the same?
- if (substr($this->bootIpPort, -strlen($ourPort), strlen($ourPort)) == $ourPort) {
+ if ($bootPort == $ourPort) {
// It is the same!
$this->getDebugInstance()->output('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->bootIpPort . '.');
}
} else {
// IP does match, but no port
- $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does match a known bootstrap-node but not the port ' . $ourPort . '.');
+ $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.');
}
} else {
// Node does not match any know bootstrap-node