Skip to content

Commit 33b9ba5

Browse files
authored
Merge pull request #3041 from G8XSU/followup-2957
Followups to #2957
2 parents 38690bf + 8861a9a commit 33b9ba5

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

lightning/src/chain/chainmonitor.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub trait Persist<ChannelSigner: WriteableEcdsaChannelSigner> {
148148
/// The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely
149149
/// links this call to [`ChainMonitor::channel_monitor_updated`].
150150
/// For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`]
151-
/// when an [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`].
151+
/// when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`].
152152
///
153153
/// See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
154154
/// [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
@@ -312,7 +312,7 @@ where C::Target: chain::Filter,
312312
log_funding_info!(monitor)
313313
),
314314
ChannelMonitorUpdateStatus::InProgress => {
315-
log_debug!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor));
315+
log_trace!(logger, "Channel Monitor sync for channel {} in progress.", log_funding_info!(monitor));
316316
},
317317
ChannelMonitorUpdateStatus::UnrecoverableError => {
318318
return Err(());
@@ -992,7 +992,6 @@ mod tests {
992992
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
993993
create_announced_chan_between_nodes(&nodes, 0, 1);
994994

995-
chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear();
996995
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::UnrecoverableError);
997996

998997
assert!(std::panic::catch_unwind(|| {

lightning/src/ln/payment_tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,6 @@ fn do_test_dup_htlc_onchain_doesnt_fail_on_reload(persist_manager_post_event: bo
11021102
// Now connect the HTLC claim transaction with the ChainMonitor-generated ChannelMonitor update
11031103
// returning InProgress. This should cause the claim event to never make its way to the
11041104
// ChannelManager.
1105-
chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear();
11061105
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
11071106

11081107
if payment_timeout {

lightning/src/util/test_utils.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ pub struct TestPersister {
513513
/// The queue of update statuses we'll return. If none are queued, ::Completed will always be
514514
/// returned.
515515
pub update_rets: Mutex<VecDeque<chain::ChannelMonitorUpdateStatus>>,
516-
/// When we get an update_persisted_channel call with no ChannelMonitorUpdate, we insert the
517-
/// MonitorId here.
518-
pub chain_sync_monitor_persistences: Mutex<VecDeque<OutPoint>>,
519516
/// When we get an update_persisted_channel call *with* a ChannelMonitorUpdate, we insert the
520517
/// [`ChannelMonitor::get_latest_update_id`] here.
521518
///
@@ -526,7 +523,6 @@ impl TestPersister {
526523
pub fn new() -> Self {
527524
Self {
528525
update_rets: Mutex::new(VecDeque::new()),
529-
chain_sync_monitor_persistences: Mutex::new(VecDeque::new()),
530526
offchain_monitor_updates: Mutex::new(new_hash_map()),
531527
}
532528
}
@@ -552,22 +548,13 @@ impl<Signer: sign::ecdsa::WriteableEcdsaChannelSigner> chainmonitor::Persist<Sig
552548

553549
if let Some(update) = update {
554550
self.offchain_monitor_updates.lock().unwrap().entry(funding_txo).or_insert(new_hash_set()).insert(update.update_id);
555-
} else {
556-
self.chain_sync_monitor_persistences.lock().unwrap().push_back(funding_txo);
557551
}
558552
ret
559553
}
560554

561555
fn archive_persisted_channel(&self, funding_txo: OutPoint) {
562556
// remove the channel from the offchain_monitor_updates map
563-
match self.offchain_monitor_updates.lock().unwrap().remove(&funding_txo) {
564-
Some(_) => {},
565-
None => {
566-
// If the channel was not in the offchain_monitor_updates map, it should be in the
567-
// chain_sync_monitor_persistences map.
568-
self.chain_sync_monitor_persistences.lock().unwrap().retain(|x| x != &funding_txo);
569-
}
570-
};
557+
self.offchain_monitor_updates.lock().unwrap().remove(&funding_txo);
571558
}
572559
}
573560

0 commit comments

Comments
 (0)