Skip to content

Commit 8861a9a

Browse files
committed
Stop tracking chain_sync_monitor_persistences in TestPersister
1 parent 7cd6030 commit 8861a9a

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ mod tests {
984984
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
985985
create_announced_chan_between_nodes(&nodes, 0, 1);
986986

987-
chanmon_cfgs[0].persister.chain_sync_monitor_persistences.lock().unwrap().clear();
988987
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::UnrecoverableError);
989988

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

lightning/src/ln/payment_tests.rs

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

11071106
if payment_timeout {

lightning/src/util/test_utils.rs

Lines changed: 1 addition & 14 deletions
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)