]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make ChannelMonitor always clonable
authorMatt Corallo <git@bluematt.me>
Mon, 1 Feb 2021 01:12:50 +0000 (20:12 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 14 May 2024 20:46:40 +0000 (20:46 +0000)
Rather than `ChannelMonitor` only being clonable when the signer is
clonable, we require all signers to be clonable and then make all
`ChannelMonitor`s clonable.

lightning/src/chain/channelmonitor.rs
lightning/src/sign/ecdsa.rs

index f3e2653844d1fea898b199ae306f17046c416d0c..d84d673cf01a4772d744455bd82bf9e0159ecbe3 100644 (file)
@@ -781,7 +781,7 @@ pub struct ChannelMonitor<Signer: WriteableEcdsaChannelSigner> {
        pub(super) inner: Mutex<ChannelMonitorImpl<Signer>>,
 }
 
-impl<Signer: WriteableEcdsaChannelSigner> Clone for ChannelMonitor<Signer> where Signer: Clone {
+impl<Signer: WriteableEcdsaChannelSigner> Clone for ChannelMonitor<Signer> {
        fn clone(&self) -> Self {
                let inner = self.inner.lock().unwrap().clone();
                ChannelMonitor::from_impl(inner)
index a0409e545059280b4e413fbf583702414aa5237d..0ca322263bde4c4bbbef06ba0c9d5667b83b518e 100644 (file)
@@ -219,4 +219,4 @@ pub trait EcdsaChannelSigner: ChannelSigner {
 ///
 /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
 /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
-pub trait WriteableEcdsaChannelSigner: EcdsaChannelSigner + Writeable {}
+pub trait WriteableEcdsaChannelSigner: EcdsaChannelSigner + Writeable + Clone {}