]> git.bitcoin.ninja Git - rust-lightning/commit
Change Mutex to RwLock in ChainMonitor
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 1 Mar 2021 06:26:41 +0000 (22:26 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 2 Mar 2021 06:12:26 +0000 (22:12 -0800)
commit389c4ad6fa21caf62c6616f879536c7b693a9d1f
tree2051cf3a58344fc55e130d28c0a51b5349638634
parent8e558feb4bcb2c3424e94ecc7c9948da54960c27
Change Mutex to RwLock in ChainMonitor

Now that ChannelMonitor uses an internal Mutex to support interior
mutability, ChainMonitor can use a RwLock to manage its ChannelMonitor
map. This allows parallelization of update_channel operations since an
exclusive lock only needs to be held when adding to the map in
watch_channel.
lightning/src/chain/chainmonitor.rs
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/util/test_utils.rs