Skip to content

Commit

Permalink
Merge branch 'master' into scalahub-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
catena2w authored Jun 28, 2019
2 parents 04ae509 + 399cef0 commit e3430c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ trait HeadersProcessor extends ToDownloadProcessor with ScorexLogging with Score

protected val config: NodeConfigurationSettings

protected val chainSettings: ChainSettings

val powScheme: AutolykosPowScheme

//Maximum time in future block header may contain
Expand Down Expand Up @@ -266,8 +268,11 @@ trait HeadersProcessor extends ToDownloadProcessor with ScorexLogging with Score
.validateEqualIds(hdrGenesisParent, header.parentId, Header.GenesisParentId)
.validateOrSkipFlatten(hdrGenesisFromConfig, chainSettings.genesisId, (id: ModifierId) => id.equals(header.id))
.validate(hdrGenesisHeight, header.height == GenesisHeight, header.toString)
.validateNoFailure(hdrPoW, powScheme.validate(header))
.validateEquals(hdrRequiredDifficulty, header.requiredDifficulty, chainSettings.initialDifficulty)
.validateNot(alreadyApplied, historyStorage.contains(header.id), header.id.toString)
.validate(hdrTooOld, fullBlockHeight < config.keepVersions, heightOf(header.parentId).toString)
.validate(hdrFutureTimestamp, header.timestamp - timeProvider.time() <= MaxTimeDrift, s"${header.timestamp} vs ${timeProvider.time()}")
.result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class InfoRoutesSpec extends FlatSpec
implicit val routeTimeout: RouteTestTimeout = RouteTestTimeout(15.seconds.dilated)
val statsCollector: ActorRef = ErgoStatsCollectorRef(nodeViewRef, peerManagerRef, settings, fakeTimeProvider)
val route: Route = InfoRoute(statsCollector, settings.scorexSettings.restApi, fakeTimeProvider).route
val requiredDifficulty = BigInt(320000000)
val requiredDifficulty = BigInt(1)

override def beforeAll: Unit = {
Await.ready(initDifficulty(requiredDifficulty), actorTimeout.duration)
Expand Down

0 comments on commit e3430c2

Please sign in to comment.