/// think we've fallen behind!
should_broadcast: bool,
},
+ ShutdownScript {
+ scriptpubkey: Script,
+ },
}
impl_writeable_tlv_based_enum!(ChannelMonitorUpdateStep,
(4, ChannelForceClosed) => {
(0, should_broadcast, required),
},
+ (5, ShutdownScript) => {
+ (0, scriptpubkey, required),
+ },
;);
/// A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
// shouldn't print the scary warning above.
log_info!(logger, "Channel off-chain state closed after we broadcasted our latest commitment transaction.");
}
- }
+ },
+ ChannelMonitorUpdateStep::ShutdownScript { scriptpubkey } => {
+ log_trace!(logger, "Updating ChannelMonitor with shutdown script");
+ if let Some(shutdown_script) = self.shutdown_script.replace(scriptpubkey.clone()) {
+ panic!("Attempted to replace shutdown script {} with {}", shutdown_script, scriptpubkey);
+ }
+ },
}
}
self.latest_update_id = updates.update_id;