Skip to content

Commit a18152b

Browse files
committed
fixed epoch
1 parent de14d70 commit a18152b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/scala/mvp2/actors/Planner.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class Planner(settings: Settings) extends CommonActor {
3131
val networker: ActorSelection = context.system.actorSelection("/user/starter/blockchainer/networker")
3232
var scheduleForWriting: List[ByteString] = List()
3333
var hasWritten: Boolean = false
34-
var needToCheckTimeToPublish: Boolean = true
3534

3635
override def specialBehavior: Receive = {
3736
case SyncingDone =>
@@ -60,7 +59,6 @@ class Planner(settings: Settings) extends CommonActor {
6059
def syncedNode: Receive = {
6160
case keyBlock: KeyBlock =>
6261
nextPeriod = Period(keyBlock, settings)
63-
needToCheckTimeToPublish = true
6462
lastBlock = keyBlock
6563
epoch = epoch.dropNextPublisherPublicKey
6664
if (lastBlock.scheduler.nonEmpty) hasWritten = true
@@ -88,10 +86,9 @@ class Planner(settings: Settings) extends CommonActor {
8886
logger.info(s"Current public keys: ${allPublicKeys.map(EncodingUtils.encode2Base16).mkString(",")}")
8987
scheduleForWriting = epoch.schedule
9088
checkMyTurn(scheduleForWriting)
91-
case Tick if nextPeriod.timeToPublish && needToCheckTimeToPublish =>
89+
case Tick if nextPeriod.timeToPublish =>
9290
logger.info(s"nextPeriod.timeToPublish. Height of last block is: ${lastBlock.height}")
9391
checkMyTurn(scheduleForWriting)
94-
needToCheckTimeToPublish = false
9592
logger.info(s"Current epoch is: $epoch. Height of last block is: ${lastBlock.height}")
9693
logger.info(s"Current public keys: ${allPublicKeys.map(EncodingUtils.encode2Base16).mkString(",")}")
9794
checkScheduleUpdateTime()
@@ -104,7 +101,6 @@ class Planner(settings: Settings) extends CommonActor {
104101
if (!hasWritten) epoch = Epoch(epoch.schedule)
105102
checkMyTurn(scheduleForWriting)
106103
context.parent ! nextPeriod
107-
needToCheckTimeToPublish = true
108104
checkScheduleUpdateTime()
109105
case Tick =>
110106
logger.info("123")

0 commit comments

Comments
 (0)