X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=a3f89de96f8d5c3ed8622ab77ed154174f3fbd37;hb=3b277cc39427d1f1bdbce4a4c2eea2dee493f9f0;hp=a4abd32adc29b2dddb6b306b7fa3ffdc08c57959;hpb=d271d74bc71cf8a825be38734aaceb57e2d5d0a3;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index a4abd32ad..a3f89de96 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -240,6 +240,8 @@ pub(super) struct Channel { secp_ctx: Secp256k1, channel_value_satoshis: u64, + latest_monitor_update_id: u64, + #[cfg(not(test))] local_keys: ChanSigner, #[cfg(test)] @@ -470,6 +472,8 @@ impl Channel { secp_ctx: secp_ctx, channel_value_satoshis: channel_value_satoshis, + latest_monitor_update_id: 0, + local_keys: chan_keys, shutdown_pubkey: keys_provider.get_shutdown_pubkey(), cur_local_commitment_transaction_number: INITIAL_COMMITMENT_NUMBER, @@ -691,6 +695,8 @@ impl Channel { channel_outbound: false, secp_ctx: secp_ctx, + latest_monitor_update_id: 0, + local_keys: chan_keys, shutdown_pubkey: keys_provider.get_shutdown_pubkey(), cur_local_commitment_transaction_number: INITIAL_COMMITMENT_NUMBER, @@ -2908,6 +2914,10 @@ impl Channel { self.channel_update_count } + pub fn get_latest_monitor_update_id(&self) -> u64 { + self.latest_monitor_update_id + } + pub fn should_announce(&self) -> bool { self.config.announced_channel } @@ -3673,6 +3683,8 @@ impl Writeable for Channel { self.channel_outbound.write(writer)?; self.channel_value_satoshis.write(writer)?; + self.latest_monitor_update_id.write(writer)?; + self.local_keys.write(writer)?; self.shutdown_pubkey.write(writer)?; @@ -3870,6 +3882,8 @@ impl> ReadableArgs> ReadableArgs