@@ -2109,11 +2109,6 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2109
2109
self.channel_keys_id
2110
2110
}
2111
2111
2112
- pub fn increment_and_fetch_monitor_update_id(&mut self) -> u64 {
2113
- self.latest_monitor_update_id +=1;
2114
- self.latest_monitor_update_id
2115
- }
2116
-
2117
2112
pub fn get_latest_monitor_update_id(&self) -> u64 {
2118
2113
self.latest_monitor_update_id
2119
2114
}
@@ -4544,6 +4539,22 @@ impl<SP: Deref> Channel<SP> where
4544
4539
return Ok(self.push_ret_blockable_mon_update(monitor_update));
4545
4540
}
4546
4541
4542
+ /// Used to send LatestPeerStorage to the corresponding `ChannelMonitor`
4543
+ pub fn update_peer_storage(&mut self, data: Vec<u8>) -> ChannelMonitorUpdate {
4544
+ self.context.latest_monitor_update_id += 1;
4545
+ let monitor_update = ChannelMonitorUpdate {
4546
+ update_id: self.context.latest_monitor_update_id,
4547
+ counterparty_node_id: None,
4548
+ updates: vec![ChannelMonitorUpdateStep::LatestPeerStorage {
4549
+ data,
4550
+ }],
4551
+ channel_id: Some(self.context.channel_id()),
4552
+ };
4553
+ self.monitor_updating_paused(false, false, false, Vec::new(), Vec::new(), Vec::new());
4554
+
4555
+ monitor_update
4556
+ }
4557
+
4547
4558
/// Public version of the below, checking relevant preconditions first.
4548
4559
/// If we're not in a state where freeing the holding cell makes sense, this is a no-op and
4549
4560
/// returns `(None, Vec::new())`.
0 commit comments