Track last_block_hash in ChannelMonitor and expose it on deser
[rust-lightning] / src / ln / channel.rs
index 9935f88cf26388ee4df53b8d1fc310c2efaa9dcd..28b938ec569f7762307f13e08d05a7a87a73bbb5 100644 (file)
@@ -2674,6 +2674,7 @@ impl Channel {
                if self.funding_tx_confirmations > 0 {
                        if header.bitcoin_hash() != self.last_block_connected {
                                self.last_block_connected = header.bitcoin_hash();
+                               self.channel_monitor.last_block_hash = self.last_block_connected;
                                self.funding_tx_confirmations += 1;
                                if self.funding_tx_confirmations == Channel::derive_minimum_depth(self.channel_value_satoshis*1000, self.value_to_self_msat) as u64 {
                                        let need_commitment_update = if non_shutdown_state == ChannelState::FundingSent as u32 {