Skip to content

Commit d92070b

Browse files
committed
ec-fix
1 parent ddd8e66 commit d92070b

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/main/scala/encry/nvg/ModifiersValidator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ModifiersValidator(
101101

102102
}
103103

104-
object ModifiersValidator {
104+
object ModifiersValidator extends StrictLogging {
105105

106106
final case class ModifierForValidation(
107107
historyReader: HistoryReader,

src/main/scala/encry/nvg/NVHHistory.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class NVHHistory(settings: EncryAppSettings, ntp: NetworkTimeProvider)
142142
def requestDownloads(pi: ProgressInfo, previousModifier: Option[ModifierId] = none): Unit =
143143
pi.toDownload.foreach {
144144
case (tid: ModifierTypeId, id: ModifierId) =>
145-
if (tid != Payload.modifierTypeId || (historyView.history.isFullChainSynced && tid == Payload.modifierTypeId)) {
145+
if (historyView.history.isHeadersChainSynced && tid == Payload.modifierTypeId) {
146146
logger.info(
147147
s"History holder created download request for modifier ${Algos.encode(id)} of type $tid. " +
148148
s"Previous modifier is ${previousModifier.map(Algos.encode)}."

src/main/scala/encry/nvg/NVHState.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class NVHState(influxRef: Option[ActorRef], var historyReader: HistoryReader, se
4343
case ApplyModifier(modifier: PersistentModifier,
4444
saveRootNodesFlag: Boolean,
4545
isFullChainSynced: Boolean) =>
46+
logger.info(s"Going to apply modifier: ${Algos.encode(modifier.id)}")
4647
state.applyModifier(modifier, saveRootNodesFlag) match {
4748
case Right(stateAfterApply) =>
4849
modifier match {

src/main/scala/encry/view/history/HistoryApi.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ trait HistoryApi extends HistoryDBApi { //scalastyle:ignore
296296
case None => (None, headerChainBack(toHeader.height + 1, toHeader, _ => false))
297297
}
298298

299-
def isNewHeader(header: Header): Boolean =
300-
timeProvider.estimatedTime - header.timestamp <
301-
settings.constants.DesiredBlockInterval.toMillis * settings.constants.NewHeaderTimeMultiplier
299+
def isNewHeader(header: Header): Boolean = {
300+
// logger.info(s"Is new header (${header.encodedId}): ${timeProvider.estimatedTime - header.timestamp <
301+
// settings.constants.DesiredBlockInterval.toMillis * settings.constants.NewHeaderTimeMultiplier}")
302+
header.height == 38999
303+
}
302304

303305
def isHeadersChainSynced: Boolean = isHeadersChainSyncedVar
304306

0 commit comments

Comments
 (0)