@@ -31,6 +31,7 @@ class Planner(settings: Settings) extends CommonActor {
3131 var scheduleForWriting : List [ByteString ] = List ()
3232 var hasWritten : Boolean = false
3333 var needToCheckTimeToPublish : Boolean = true
34+ var isRemoved : Boolean = false
3435
3536 override def specialBehavior : Receive = {
3637 case SyncingDone =>
@@ -61,6 +62,7 @@ class Planner(settings: Settings) extends CommonActor {
6162 nextPeriod = Period (keyBlock, settings)
6263 needToCheckTimeToPublish = true
6364 lastBlock = keyBlock
65+ if (! isRemoved) epoch.dropNextPublisherPublicKey
6466 if (lastBlock.scheduler.nonEmpty) hasWritten = true
6567 logger.info(s " Last block was updated. Height of last block is: ${lastBlock.height}. Period was updated. " +
6668 s " New period is: $nextPeriod. " )
@@ -86,13 +88,15 @@ class Planner(settings: Settings) extends CommonActor {
8688 logger.info(s " Current public keys: ${allPublicKeys.map(EncodingUtils .encode2Base16).mkString(" ," )}" )
8789 scheduleForWriting = epoch.schedule
8890 checkMyTurn(scheduleForWriting)
91+ isRemoved = true
8992 case Tick if nextPeriod.timeToPublish && needToCheckTimeToPublish =>
93+ logger.info(s " nextPeriod.timeToPublish. Height of last block is: ${lastBlock.height}" )
9094 checkMyTurn(scheduleForWriting)
9195 needToCheckTimeToPublish = false
96+ isRemoved = true
9297 logger.info(s " Current epoch is: $epoch. Height of last block is: ${lastBlock.height}" )
9398 logger.info(s " Current public keys: ${allPublicKeys.map(EncodingUtils .encode2Base16).mkString(" ," )}" )
9499 checkScheduleUpdateTime()
95- logger.info(s " nextPeriod.timeToPublish. Height of last block is: ${lastBlock.height}" )
96100 case Tick if nextPeriod.noBlocksInTime =>
97101 logger.info(s " nextPeriod.noBlocksInTime. Height of last block is: ${lastBlock.height}" )
98102 // epoch = epoch.dropNextPublisherPublicKey
@@ -104,6 +108,7 @@ class Planner(settings: Settings) extends CommonActor {
104108 context.parent ! nextPeriod
105109 needToCheckTimeToPublish = true
106110 checkScheduleUpdateTime()
111+ isRemoved = true
107112 case Tick =>
108113 logger.info(" 123" )
109114 // logger.info(s"Current epoch is: $epoch. Height of last block is: ${lastBlock.height}")
0 commit comments