+
+ // Post-handling of message data
+ $handlerInstance->postHandleMessageData($messageArray, $this);
+ }
+
+ /**
+ * Feeds the hash and sender (as recipient for the 'sender' reward) to the
+ * miner's queue, unless the message is not a "reward claim" message as this
+ * leads to an endless loop. You may wish to run the miner to get some
+ * reward ("Hubcoins") for "mining" this hash.
+ *
+ * @param $messageData Array with message data
+ * @return void
+ * @todo ~10% done?
+ */
+ public function feedHashToMiner (array $messageData) {
+ // Is the feature enabled?
+ if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) {
+ /*
+ * Feature is not enabled, don't feed the hash to the miner as it
+ *may be invalid.
+ */
+ return;
+ } // END - if
+
+ // Make sure the required elements are there
+ assert(isset($messageData[self::MESSAGE_ARRAY_SENDER]));
+ assert(isset($messageData[self::MESSAGE_ARRAY_HASH]));
+ assert(isset($messageData[self::MESSAGE_ARRAY_TAGS]));
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: messageData=' . print_r($messageData, TRUE));
+
+ // Resolve session id ('sender' is a session id) into node id
+ $nodeId = HubTools::resolveNodeIdBySessionId($messageData[self::MESSAGE_ARRAY_SENDER]);
+
+ // Is 'claim_reward' the message type?
+ if (in_array('claim_reward', $messageData[self::MESSAGE_ARRAY_TAGS])) {
+ /*
+ * Then don't feed this message to the miner as this causes an
+ * endless loop of mining.
+ */
+ return;
+ } // END - if
+
+ $this->partialStub('@TODO nodeId=' . $nodeId . ',messageData=' . print_r($messageData, TRUE));