]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/lookup/peer/class_PeerStateLookupTable.php
We use these setter/getter
[hub.git] / application / hub / main / lookup / peer / class_PeerStateLookupTable.php
index 35095adb1ba2d633968cef7cc3669a53f94ae485..fcf78f64758c455d46a5f35728b7e2343d18b293 100644 (file)
@@ -37,9 +37,9 @@ class PeerStateLookupTable extends BaseLookupTable implements Lookupable {
         *
         * @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');
@@ -50,6 +50,20 @@ class PeerStateLookupTable extends BaseLookupTable implements Lookupable {
                // 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->getWrapperInstance()->isSenderNewPeer($packageData);
+
+               // Return it
+               return $isNewPeer;
+       }
 }
 
 // [EOF]