ENT-1683 Ensuring that the updateDeadline time is in the future (#609)

* Ensuring that the updateDeadline time is in the future

* Addressing review comments
This commit is contained in:
Michal Kit 2018-03-27 15:20:08 +01:00 committed by GitHub
parent 3ce5dac90f
commit 68cdd5e374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,12 @@ data class NotaryConfig(private val notaryNodeInfoFile: Path,
}
}
data class ParametersUpdateConfig(val description: String, val updateDeadline: Instant)
data class ParametersUpdateConfig(val description: String, val updateDeadline: Instant) {
init {
val now = Instant.now()
require(updateDeadline == now || updateDeadline.isAfter(now)) { "The updateDeadline time must be in the future." }
}
}
/**
* Data class containing the fields from [NetworkParameters] which can be read at start-up time from doorman.