You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Store + process pending ChannelMonitorUpdates in Channel
The previous commits set up the ability for us to hold
`ChannelMonitorUpdate`s which are pending until we're ready to pass
them to users and have them be applied. However, if the
`ChannelManager` is persisted while we're waiting to give the user
a `ChannelMonitorUpdate` we'll be confused on restart - seeing our
latest `ChannelMonitor` state as stale compared to our
`ChannelManager` - a critical error.
Luckily the solution is trivial, we simply need to store the
pending `ChannelMonitorUpdate` state and load it with the
`ChannelManager` data, allowing stale monitors on load as long as
we have the missing pending updates between where we are and the
latest `ChannelMonitor` state.
if channel.get_latest_complete_monitor_update_id() > monitor.get_latest_update_id(){
7513
7510
// If the channel is ahead of the monitor, return InvalidValue:
7514
7511
log_error!(args.logger,"A ChannelMonitor is stale compared to the current ChannelManager! This indicates a potentially-critical violation of the chain::Watch API!");
7515
7512
log_error!(args.logger," The ChannelMonitor for channel {} is at update_id {} but the ChannelManager is at update_id {}.",
0 commit comments