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, 23 Jan 2024 19:55:39 +0000 (19:55 +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 6e1841281b79e9a5b8c59bb497bda9270d99dd99..1284553e74c4438876adfae913c2fc7519a57b69 100644 (file)
@@ -753,7 +753,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 2e98213c1825f2c0af8802bcc0838c2dc4d7af55..d00800e62326301bfd02974db11d779c65e9ab04 100644 (file)
@@ -167,4 +167,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 {}