X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Fdht%2Fnode%2Fclass_NodeDhtFacade.php;h=dd6d13a1c8a05c299109b3687fa898b92cc8d457;hb=4a4fbfb80267fd344b37cef2b173f666ecb44646;hp=44efb9a1b92cc5971eb4ee50ddbfcc9a582dc66f;hpb=2e00f351966a192c4b65e2dc64c4dad17e59a36c;p=hub.git diff --git a/application/hub/main/dht/node/class_NodeDhtFacade.php b/application/hub/main/dht/node/class_NodeDhtFacade.php index 44efb9a1b..dd6d13a1c 100644 --- a/application/hub/main/dht/node/class_NodeDhtFacade.php +++ b/application/hub/main/dht/node/class_NodeDhtFacade.php @@ -52,13 +52,20 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable { } /** - * Initializes the distributable hash table (DHT) + * Initializes the distributed hash table (DHT) * * @return void * @todo Please implement this method */ public function initDht () { - $this->partialStub('Please implement this method.'); + // Is the local node registered? + if ($this->getWrapperInstance()->isLocalNodeRegistered()) { + // Then only update session id + $this->getWrapperInstance()->updateLocalNode(); + } else { + // No, so register it + $this->getWrapperInstance()->registerLocalNode(); + } } }