]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add a comment describing `update_time_counter` and when its updated
authorMatt Corallo <git@bluematt.me>
Tue, 16 Nov 2021 20:55:10 +0000 (20:55 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 23 Nov 2021 22:18:00 +0000 (22:18 +0000)
lightning/src/ln/channel.rs

index 0cf7995bce38a03907c5a4147433085a9ae49054..55dd76cc033faee51a13dad560f6ce64595db858 100644 (file)
@@ -481,9 +481,14 @@ pub(super) struct Channel<Signer: Sign> {
        holding_cell_update_fee: Option<u32>,
        next_holder_htlc_id: u64,
        next_counterparty_htlc_id: u64,
-       update_time_counter: u32,
        feerate_per_kw: u32,
 
+       /// The timestamp set on our latest `channel_update` message for this channel. It is updated
+       /// when the channel is updated in ways which may impact the `channel_update` message or when a
+       /// new block is received, ensuring it's always at least moderately close to the current real
+       /// time.
+       update_time_counter: u32,
+
        #[cfg(debug_assertions)]
        /// Max to_local and to_remote outputs in a locally-generated commitment transaction
        holder_max_commitment_tx_output: Mutex<(u64, u64)>,