- }
-
- /// Used in Channel to cheat wrt the update_ids since it plays games, will be removed soon!
- pub(super) fn update_monitor_ooo<L: Deref>(&mut self, mut updates: ChannelMonitorUpdate, logger: &L) -> Result<(), MonitorUpdateError> where L::Target: Logger {
- for update in updates.updates.drain(..) {
- match update {
- ChannelMonitorUpdateStep::LatestLocalCommitmentTXInfo { commitment_tx, htlc_outputs } => {
- if self.lockdown_from_offchain { panic!(); }
- self.provide_latest_local_commitment_tx_info(commitment_tx, htlc_outputs)?
- },
- ChannelMonitorUpdateStep::LatestRemoteCommitmentTXInfo { unsigned_commitment_tx, htlc_outputs, commitment_number, their_revocation_point } =>
- self.provide_latest_remote_commitment_tx_info(&unsigned_commitment_tx, htlc_outputs, commitment_number, their_revocation_point, logger),
- ChannelMonitorUpdateStep::PaymentPreimage { payment_preimage } =>
- self.provide_payment_preimage(&PaymentHash(Sha256::hash(&payment_preimage.0[..]).into_inner()), &payment_preimage),
- ChannelMonitorUpdateStep::CommitmentSecret { idx, secret } =>
- self.provide_secret(idx, secret)?,
- ChannelMonitorUpdateStep::ChannelForceClosed { .. } => {},
- }
- }
- self.latest_update_id = updates.update_id;
- Ok(())