Skip to content

Commit 5709160

Browse files
committed
fixed mining scheduler
1 parent e5328c1 commit 5709160

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/scala/units/ELUpdater.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ 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) {
364-
Some(timestampAheadTime.seconds)
364+
Some(timestampAheadTime.millis)
365365
} else if (!chainContractClient.blockExists(referenceHash)) {
366366
Some(WaitForReferenceConfirmInterval)
367367
} else None
@@ -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)