+ // Now get the search instance from given package data
+ $searchInstance = $this->getSenderSearchInstanceFromPackageData($packageData);
+
+ // With this search instance query the database for the peer and get a result instance
+ $resultInstance = $this->doSelectByCriteria($searchInstance);
+
+ // Do we have an entry? This should always the case
+ assert($resultInstance->next());
+
+ // Yes, so get the current (=first) entry from it
+ $rowData = $resultInstance->current();
+
+ // Now just compare it with given state from helper instance
+ $isSamePeerState = ($rowData[self::DB_COLUMN_PEER_STATE] == $helperInstance->getPrintableState());
+
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('DATABASE-WRAPPER: previous state=' . $rowData[self::DB_COLUMN_PEER_STATE] . ', current state=' . $helperInstance->getPrintableState() . ',isSamePeerState=' . intval($isSamePeerState));