From 8e558feb4bcb2c3424e94ecc7c9948da54960c27 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 1 Mar 2021 12:01:43 -0800 Subject: [PATCH] Use consistent variable naming in ChainMonitor --- lightning/src/chain/chainmonitor.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index 4cb9128d9..e9cf5e8d8 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -222,15 +222,15 @@ where C::Target: chain::Filter, #[cfg(not(any(test, feature = "fuzztarget")))] Err(ChannelMonitorUpdateErr::PermanentFailure) }, - Some(orig_monitor) => { - log_trace!(self.logger, "Updating Channel Monitor for channel {}", log_funding_info!(orig_monitor)); - let update_res = orig_monitor.update_monitor(&update, &self.broadcaster, &self.fee_estimator, &self.logger); + Some(monitor) => { + log_trace!(self.logger, "Updating Channel Monitor for channel {}", log_funding_info!(monitor)); + let update_res = monitor.update_monitor(&update, &self.broadcaster, &self.fee_estimator, &self.logger); if let Err(e) = &update_res { log_error!(self.logger, "Failed to update channel monitor: {:?}", e); } // Even if updating the monitor returns an error, the monitor's state will // still be changed. So, persist the updated monitor despite the error. - let persist_res = self.persister.update_persisted_channel(funding_txo, &update, orig_monitor); + let persist_res = self.persister.update_persisted_channel(funding_txo, &update, monitor); if let Err(ref e) = persist_res { log_error!(self.logger, "Failed to persist channel monitor update: {:?}", e); } @@ -245,8 +245,8 @@ where C::Target: chain::Filter, fn release_pending_monitor_events(&self) -> Vec { let mut pending_monitor_events = Vec::new(); - for chan in self.monitors.lock().unwrap().values_mut() { - pending_monitor_events.append(&mut chan.get_and_clear_pending_monitor_events()); + for monitor in self.monitors.lock().unwrap().values_mut() { + pending_monitor_events.append(&mut monitor.get_and_clear_pending_monitor_events()); } pending_monitor_events } @@ -261,8 +261,8 @@ impl even { fn get_and_clear_pending_events(&self) -> Vec { let mut pending_events = Vec::new(); - for chan in self.monitors.lock().unwrap().values_mut() { - pending_events.append(&mut chan.get_and_clear_pending_events()); + for monitor in self.monitors.lock().unwrap().values_mut() { + pending_events.append(&mut monitor.get_and_clear_pending_events()); } pending_events } -- 2.39.5