Skip to content

Commit 495b7af

Browse files
committed
fixed mining scheduler
1 parent e5328c1 commit 495b7af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/scala/units/ELUpdater.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class ELUpdater(
359359
chainContractOptions: ChainContractOptions
360360
): Unit = {
361361
def waitForRefApprovalOnCl: Option[FiniteDuration] = {
362-
val timestampAheadTime = (timestamp - time.correctedTime() / 1000).max(0)
362+
val timestampAheadTime = (timestamp * 1000 - time.correctedTime()).max(0)
363363
if (timestampAheadTime > 0) {
364364
Some(timestampAheadTime.seconds)
365365
} else if (!chainContractClient.blockExists(referenceHash)) {
@@ -476,7 +476,7 @@ class ELUpdater(
476476
}
477477

478478
// TODO: See a comment about prepareAndApplyPayload call above
479-
scheduler.scheduleOnceLabeled("forgeSecond", (nextBlockUnixTs - time.correctedTime() / 1000).min(1).seconds)(
479+
scheduler.scheduleOnceLabeled("forgeSecond", (nextBlockUnixTs * 1000 - time.correctedTime()).min(200).millis)(
480480
tryToForgeNextBlock(
481481
payloadOrId = nextMiningData.payload,
482482
referenceHash = ecBlock.hash,

0 commit comments

Comments
 (0)