Skip to content

Commit b0978a8

Browse files
committed
Move ChannelMonitor state behind a Mutex
ChainMonitor accesses a set of ChannelMonitors behind a single Mutex. As a result, update_channel operations cannot be parallelized. It also requires using a RefCell around a ChannelMonitor when implementing chain::Listen. Moving the Mutex into ChannelMonitor avoids these problems and aligns it better with other interfaces. Note, however, that get_funding_txo and get_outputs_to_watch now clone the underlying data rather than returning references.
1 parent 9fba7c9 commit b0978a8

File tree

5 files changed

+328
-150
lines changed

5 files changed

+328
-150
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl chain::Watch<EnforcingSigner> for TestChainMonitor {
126126
hash_map::Entry::Occupied(entry) => entry,
127127
hash_map::Entry::Vacant(_) => panic!("Didn't have monitor on update call"),
128128
};
129-
let mut deserialized_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::
129+
let deserialized_monitor = <(BlockHash, channelmonitor::ChannelMonitor<EnforcingSigner>)>::
130130
read(&mut Cursor::new(&map_entry.get().1), &OnlyReadsKeysInterface {}).unwrap().1;
131131
deserialized_monitor.update_monitor(&update, &&TestBroadcaster{}, &&FuzzEstimator{}, &self.logger).unwrap();
132132
let mut ser = VecWriter(Vec::new());

0 commit comments

Comments
 (0)