diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index c68e9a7169e..0a146c94084 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -148,7 +148,7 @@ pub trait Persist { /// The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely /// links this call to [`ChainMonitor::channel_monitor_updated`]. /// For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`] - /// when an [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. + /// when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`]. /// /// See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, /// [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and @@ -310,7 +310,7 @@ where C::Target: chain::Filter, log_funding_info!(monitor) ), ChannelMonitorUpdateStatus::InProgress => { - log_debug!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor)); + log_trace!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor)); }, ChannelMonitorUpdateStatus::UnrecoverableError => { return Err(()); @@ -984,7 +984,6 @@ mod tests { let nodes = create_network(2, &node_cfgs, &node_chanmgrs); create_announced_chan_between_nodes(&nodes, 0, 1); - chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear(); chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::UnrecoverableError); assert!(std::panic::catch_unwind(|| { diff --git a/lightning/src/ln/payment_tests.rs b/lightning/src/ln/payment_tests.rs index 33cabbf25b0..b7af959311b 100644 --- a/lightning/src/ln/payment_tests.rs +++ b/lightning/src/ln/payment_tests.rs @@ -1101,7 +1101,6 @@ fn do_test_dup_htlc_onchain_doesnt_fail_on_reload(persist_manager_post_event: bo // Now connect the HTLC claim transaction with the ChainMonitor-generated ChannelMonitor update // returning InProgress. This should cause the claim event to never make its way to the // ChannelManager. - chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear(); chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress); if payment_timeout { diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 642e548e606..d3a4f7181cd 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -513,9 +513,6 @@ pub struct TestPersister { /// The queue of update statuses we'll return. If none are queued, ::Completed will always be /// returned. pub update_rets: Mutex>, - /// When we get an update_persisted_channel call with no ChannelMonitorUpdate, we insert the - /// MonitorId here. - pub chain_sync_monitor_persistences: Mutex>, /// When we get an update_persisted_channel call *with* a ChannelMonitorUpdate, we insert the /// [`ChannelMonitor::get_latest_update_id`] here. /// @@ -526,7 +523,6 @@ impl TestPersister { pub fn new() -> Self { Self { update_rets: Mutex::new(VecDeque::new()), - chain_sync_monitor_persistences: Mutex::new(VecDeque::new()), offchain_monitor_updates: Mutex::new(new_hash_map()), } } @@ -552,22 +548,13 @@ impl chainmonitor::Persist {}, - None => { - // If the channel was not in the offchain_monitor_updates map, it should be in the - // chain_sync_monitor_persistences map. - self.chain_sync_monitor_persistences.lock().unwrap().retain(|x| x != &funding_txo); - } - }; + self.offchain_monitor_updates.lock().unwrap().remove(&funding_txo); } }