corda / net.corda.core.transactions / TransactionBuilder / setTimeWindow

setTimeWindow

fun setTimeWindow(timeWindow: TimeWindow): TransactionBuilder

Sets the TimeWindow for this transaction, replacing the existing TimeWindow if there is one. To be valid, the transaction must then be signed by the notary service within this window of time. In this way, the notary acts as the Timestamp Authority.

fun setTimeWindow(time: Instant, timeTolerance: Duration): TransactionBuilder

The TimeWindow for the transaction can also be defined as time +/- timeTolerance. The tolerance should be chosen such that your code can finish building the transaction and sending it to the Timestamp Authority within that window of time, taking into account factors such as network latency. Transactions being built by a group of collaborating parties may therefore require a higher time tolerance than a transaction being built by a single node.