Skip to content

Commit b8d4ac1

Browse files
authored
Merge pull request #2957 from G8XSU/pause-events
Don't pause events for chainsync persistence
2 parents 37c431a + 4d5de1f commit b8d4ac1

File tree

6 files changed

+130
-334
lines changed

6 files changed

+130
-334
lines changed

fuzz/src/utils/test_persister.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use lightning::chain;
22
use lightning::chain::{chainmonitor, channelmonitor};
3-
use lightning::chain::chainmonitor::MonitorUpdateId;
43
use lightning::chain::transaction::OutPoint;
54
use lightning::util::test_channel_signer::TestChannelSigner;
65

@@ -10,11 +9,11 @@ pub struct TestPersister {
109
pub update_ret: Mutex<chain::ChannelMonitorUpdateStatus>,
1110
}
1211
impl chainmonitor::Persist<TestChannelSigner> for TestPersister {
13-
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>, _update_id: MonitorUpdateId) -> chain::ChannelMonitorUpdateStatus {
12+
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
1413
self.update_ret.lock().unwrap().clone()
1514
}
1615

17-
fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>, _update_id: MonitorUpdateId) -> chain::ChannelMonitorUpdateStatus {
16+
fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
1817
self.update_ret.lock().unwrap().clone()
1918
}
2019

lightning-persister/src/fs_store.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,6 @@ mod tests {
448448
nodes[1].node.force_close_broadcasting_latest_txn(&chan.2, &nodes[0].node.get_our_node_id()).unwrap();
449449
check_closed_event!(nodes[1], 1, ClosureReason::HolderForceClosed, [nodes[0].node.get_our_node_id()], 100000);
450450
let mut added_monitors = nodes[1].chain_monitor.added_monitors.lock().unwrap();
451-
let update_map = nodes[1].chain_monitor.latest_monitor_update_id.lock().unwrap();
452-
let update_id = update_map.get(&added_monitors[0].1.channel_id()).unwrap();
453451

454452
// Set the store's directory to read-only, which should result in
455453
// returning an unrecoverable failure when we then attempt to persist a
@@ -463,7 +461,7 @@ mod tests {
463461
txid: Txid::from_str("8984484a580b825b9972d7adb15050b3ab624ccd731946b3eeddb92f4e7ef6be").unwrap(),
464462
index: 0
465463
};
466-
match store.persist_new_channel(test_txo, &added_monitors[0].1, update_id.2) {
464+
match store.persist_new_channel(test_txo, &added_monitors[0].1) {
467465
ChannelMonitorUpdateStatus::UnrecoverableError => {},
468466
_ => panic!("unexpected result from persisting new channel")
469467
}
@@ -500,7 +498,7 @@ mod tests {
500498
txid: Txid::from_str("8984484a580b825b9972d7adb15050b3ab624ccd731946b3eeddb92f4e7ef6be").unwrap(),
501499
index: 0
502500
};
503-
match store.persist_new_channel(test_txo, &added_monitors[0].1, update_id.2) {
501+
match store.persist_new_channel(test_txo, &added_monitors[0].1) {
504502
ChannelMonitorUpdateStatus::UnrecoverableError => {},
505503
_ => panic!("unexpected result from persisting new channel")
506504
}

0 commit comments

Comments
 (0)