From: Roland Häder Date: Thu, 17 May 2012 19:22:53 +0000 (+0000) Subject: Added method nodeHasSelfConnected() which changes the state to 'reachable' which... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7211b3332bdc2692391a677f4d934a095e7be5f1;p=hub.git Added method nodeHasSelfConnected() which changes the state to 'reachable' which is true from the node's self-view --- diff --git a/application/hub/main/states/node/active/class_NodeActiveState.php b/application/hub/main/states/node/active/class_NodeActiveState.php index d73bc9900..96de63ac1 100644 --- a/application/hub/main/states/node/active/class_NodeActiveState.php +++ b/application/hub/main/states/node/active/class_NodeActiveState.php @@ -64,6 +64,20 @@ class NodeActiveState extends BaseNodeState implements Stateable { // Create the new state instance NodeStateFactory::createNodeStateInstanceByName('announced', $this->getNodeInstance()); } + + /** + * State change for if the node has just connected to itself and + * node/session id are both equal. The self-connect means that + * the node possibly reachable from outside. This may require + * confirmation by other peers. + * + * @return void + * @todo We might want to move some calls to this method to fill it with life + */ + public function nodeHasSelfConnected () { + // Create the new state instance + NodeStateFactory::createNodeStateInstanceByName('reachable', $this->getNodeInstance()); + } } // [EOF] diff --git a/application/hub/main/states/node/init/class_NodeInitState.php b/application/hub/main/states/node/init/class_NodeInitState.php index a8bd59f1a..68b968ef1 100644 --- a/application/hub/main/states/node/init/class_NodeInitState.php +++ b/application/hub/main/states/node/init/class_NodeInitState.php @@ -63,7 +63,6 @@ class NodeInitState extends BaseNodeState implements Stateable { // Create the new state instance NodeStateFactory::createNodeStateInstanceByName('virgin', $this->getNodeInstance()); } - } // [EOF]