]> 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, 3 Oct 2023 23:36:07 +0000 (23:36 +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/mod.rs

index 29a07dae90569bc9a76c8a0245a576994d28746a..9fa402c53e57e681cf4852652cd4f96ed289207f 100644 (file)
@@ -737,7 +737,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 04c4446e2c0c8c75bd4f2f7e3b415b8f35296cf2..bc317246adcb10cb8dde6a26f8989dbbd46cd444 100644 (file)
@@ -612,7 +612,7 @@ 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 {}
 
 /// Specifies the recipient of an invoice.
 ///