Exemple #1
0
 def start_timer(self, timer_service: TimerService):
     self._loop = timer_service.get_event_loop()
     self.__lock = asyncio.Lock(loop=self._loop)
     self.__block_generation_timer = SlotTimer(
         TimerService.TIMER_KEY_BLOCK_GENERATE,
         conf.INTERVAL_BLOCKGENERATION, timer_service, self.consensus,
         self.__lock, self._loop)
     self.__block_generation_timer.start()
 def start_timer(self, timer_service: TimerService):
     self._loop = timer_service.get_event_loop()
     self.__lock = asyncio.Lock(loop=self._loop)
     self.__block_generation_timer = SlotTimer(
         TimerService.TIMER_KEY_BLOCK_GENERATE,
         conf.INTERVAL_BLOCKGENERATION,
         timer_service,
         self.consensus,
         self.__lock,
         self._loop,
         call_instantly=not conf.ALLOW_MAKE_EMPTY_BLOCK)
     self.__block_generation_timer.start(
         is_run_at_start=conf.ALLOW_MAKE_EMPTY_BLOCK is False)