]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/states/miner/booting/class_MinerBootingState.php
Added real genesis block producer (not funtional).
[hub.git] / application / hub / main / states / miner / booting / class_MinerBootingState.php
index 476cd4968b9d2feaa4a4dc9d13fdab3885392ed7..a30e8a641a7930923f220f24225b83326c2e7a8c 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class MinerBootingState extends BaseMinerState implements Stateable {
+       /**
+        * Array of booted producers
+        */
+       private $bootedProducer = array();
+
        /**
         * Protected constructor
         *
@@ -58,11 +63,20 @@ class MinerBootingState extends BaseMinerState implements Stateable {
         * @return      void
         */
        public function executeState (Executor $executorInstance) {
+               // Has this executor (producer) run?
+               if (isset($this->bootedProducer[$executorInstance->__toString()])) {
+                       // Then silently skip this
+                       return;
+               } // END - if
+
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('MINER-STATE: Calling prepareBlockProduction() on ' . $executorInstance->__toString() . ' ...');
 
                // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there
                $executorInstance->prepareBlockProduction($this);
+
+               // Mark producer as booted
+               $this->bootedProducer[$executorInstance->__toString()] = TRUE;
        }
 }