Skip to content

Commit 5a47124

Browse files
committed
fuzz: reload monitors with the configured status
Build the replacement persister with the configured monitor update status during reload. This keeps non-deferred restart behavior aligned with the active persistence-style matrix.
1 parent 6145674 commit 5a47124

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,7 @@ impl<'a> HarnessNode<'a> {
10791079
&mut self, use_old_mons: u8, out: &Out, router: &'a FuzzRouter, chan_type: ChanType,
10801080
) {
10811081
let logger = Self::build_logger(self.node_id, out);
1082-
// Re-registering monitors during reload reflects data that was already selected from
1083-
// simulated storage, so these startup watch_channel calls should complete immediately.
1084-
let persister = Self::build_persister(ChannelMonitorUpdateStatus::Completed);
1082+
let persister = Self::build_persister(self.persistence_style);
10851083
let chain_monitor = Self::build_chain_monitor(
10861084
&self.broadcaster,
10871085
&self.fee_estimator,
@@ -1135,14 +1133,8 @@ impl<'a> HarnessNode<'a> {
11351133
let manager = <(BlockLocator, ChanMan)>::read(&mut &self.serialized_manager[..], read_args)
11361134
.expect("Failed to read manager");
11371135
for (channel_id, mon) in monitors.drain() {
1138-
assert_eq!(
1139-
chain_monitor.watch_channel(channel_id, mon),
1140-
Ok(ChannelMonitorUpdateStatus::Completed)
1141-
);
1136+
assert_eq!(chain_monitor.watch_channel(channel_id, mon), Ok(self.persistence_style));
11421137
}
1143-
// Future monitor writes should follow the node's configured persistence style; only the
1144-
// startup watch_channel registration above is forced to Completed.
1145-
*persister.update_ret.lock().unwrap() = self.persistence_style;
11461138
self.node = manager.1;
11471139
self.monitor = chain_monitor;
11481140
self.persister = persister;

0 commit comments

Comments
 (0)