parent::doGenericBootstrapping();
// Now check if the IP address matches one of the bootstrap nodes
- if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['REMOTE_ADDR'])) {
+ if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['SERVER_ADDR'])) {
// Get our port from configuration
$ourPort = $this->getConfigInstance()->readConfig('node_listen_port');
// Is the port the same?
if (substr($this->bootIpPort, -strlen($ourPort), strlen($ourPort)) == $ourPort) {
// It is the same!
- $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: IP/port matches bootstrapping node ' . $this->bootIpPort . '.');
+ $this->getDebugInstance()->output('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->bootIpPort . '.');
// Now, does the mode match (should be 'boot'!)
if ($this->getRequestInstance()->getRequestElement('mode') == 'boot') {
// Output debug message
- $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: Our node is a valid bootstrapping node.');
+ $this->getDebugInstance()->output('BOOTSTRAP: Our node is a valid bootstrapping node.');
} else {
// Output warning
- $this->getDebugInstance()->output(__FUNCTION__.'['.__LINE__.']: WARNING! Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
+ $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
}
- } // END - if
- } // END - if
+ } 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 . '.');
+ }
+ } else {
+ // Node does not match any know bootstrap-node
+ $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does not match any known bootstrap-nodes.');
+ }
// This might not be all...
$this->partialStub('Please implement more bootsrapping steps.');