]> git.bitcoin.ninja Git - rust-lightning/commit
Move ChannelMonitor state behind a Mutex
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 1 Mar 2021 05:42:27 +0000 (21:42 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Tue, 2 Mar 2021 06:12:26 +0000 (22:12 -0800)
commitb0978a86be4fcf5e3c76f07a2b1f6a343a543fa3
tree42ff97410335d1ee761e336d5b39fe96f2ec2ea3
parent9fba7c92ad42c847923ddefc7c3f852b2eb17496
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.
fuzz/src/chanmon_consistency.rs
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs
lightning/src/util/macro_logger.rs