*/
private $acceptAnnouncements = FALSE;
+ /**
+ * Whether this node accepts DHT bootstrap requests (default: FALSE)
+ */
+ private $acceptDhtBootstrap = FALSE;
+
/**
* Protected constructor
*
return $acceptAnnouncements;
}
+ /**
+ * Checks whether this node accepts DHT bootstrap requests
+ *
+ * @return $acceptDhtBootstrap Whether this node accepts DHT bootstrap requests
+ */
+ public final function isAcceptingDhtBootstrap () {
+ // Check it (this node must be active and not shutdown!)
+ $acceptDhtBootstrap = (($this->acceptDhtBootstrap === TRUE) && ($this->isNodeActive()));
+
+ // Return it
+ return $acceptDhtBootstrap;
+ }
+
/**
* Checks whether this node has attempted to announce itself
*
$this->acceptAnnouncements = $acceptAnnouncements;
}
+ /**
+ * Enables whether this node accepts DHT bootstrap requests
+ *
+ * @param $acceptDhtBootstrap Whether this node accepts DHT bootstrap requests (default: TRUE)
+ * @return void
+ */
+ public final function enableAcceptDhtBootstrap ($acceptDhtBootstrap = TRUE) {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE[' . __METHOD__ . ':' . __LINE__ . ']: Enabling DHT bootstrap requests ...');
+ $this->acceptDhtBootstrap = $acceptDhtBootstrap;
+ }
+
/**
* Checks wether this node is accepting node-list requests
*
// Set the dht instance
$stateInstance->setDhtInstance($dhtInstance);
+ // Get node instance and enable DHT bootstrap requests
+ Registry::getRegistry()->getInstance('node')->enableAcceptDhtBootstrap();
+
// Return the prepared instance
return $stateInstance;
}