*
* @param $packageInstance An instance of a DeliverablePackage class
* @return $isHashValid Whether the hash is valid
- * @todo Unfinished area, hashes are currently NOT fully supported
+ * @throws InvalidArgumentException If $packageInstance contains no senderId
*/
private function isPackageHashValid (DeliverablePackage $packageInstance) {
// Is the feature enabled?
// Feature is not enabled, so hashes are always valid
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...');
return TRUE;
- } // END - if
+ } elseif ($packageInstance->getSenderId() == '') {
+ // Invalid $packageInstance
+ throw new InvalidArgumentException('packageInstance does not contain senderId');
+ }
// Check validity
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->senderId=%s,packageInstance->packageContent=%s,packageInstance->contentHash=%s', $packageInstance->getSenderId(), $packageInstance->getPackageContent(), $packageInstance->getContentHash()));