*
* @return $tableInstance An instance of a Lookupable class
*/
- public final static function createPeerLookupTable () {
+ public final static function createPeerStateLookupTable () {
// Get new instance
- $tableInstance = new PeerLookupTable();
+ $tableInstance = new PeerStateLookupTable();
// Get a database wrapper instance
$wrapperInstance = ObjectFactory::createObjectByConfiguredName('peer_state_lookup_db_wrapper_class');
// Set it for later re-use
- $tableInstance->setWrapperInstance($wrapperInstance);
+ $tableInstance->setDatabaseInstance($wrapperInstance);
// Return the prepared instance
return $tableInstance;
}
+
+ /**
+ * Checks wether given 'sender' is a new peer
+ *
+ * @param $packageData Raw package data
+ * @return $isNewPeer Wether 'sender' is a new peer to this node
+ */
+ public function isSenderNewPeer (array $packageData) {
+ // Get our wrapper instance and ask for it
+ $isNewPeer = $this->getDatabaseInstance()->isSenderNewPeer($packageData);
+
+ // Return it
+ return $isNewPeer;
+ }
}
// [EOF]