Skip to content

Commit 25091c1

Browse files
committed
Make ChannelMonitor always clonable
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.
1 parent 1293a8f commit 25091c1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ pub struct ChannelMonitor<Signer: EcdsaChannelSigner> {
854854
pub(super) inner: Mutex<ChannelMonitorImpl<Signer>>,
855855
}
856856

857-
impl<Signer: EcdsaChannelSigner> Clone for ChannelMonitor<Signer> where Signer: Clone {
857+
impl<Signer: EcdsaChannelSigner> Clone for ChannelMonitor<Signer> {
858858
fn clone(&self) -> Self {
859859
let inner = self.inner.lock().unwrap().clone();
860860
ChannelMonitor::from_impl(inner)

lightning/src/sign/ecdsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::sign::{ChannelSigner, HTLCDescriptor};
3333
///
3434
/// [`ChannelManager::signer_unblocked`]: crate::ln::channelmanager::ChannelManager::signer_unblocked
3535
/// [`ChainMonitor::signer_unblocked`]: crate::chain::chainmonitor::ChainMonitor::signer_unblocked
36-
pub trait EcdsaChannelSigner: ChannelSigner {
36+
pub trait EcdsaChannelSigner: ChannelSigner + Clone {
3737
/// Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3838
///
3939
/// Policy checks should be implemented in this function, including checking the amount

lightning/src/sign/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,11 +2510,11 @@ impl EntropySource for RandomBytes {
25102510
}
25112511
}
25122512

2513-
// Ensure that EcdsaChannelSigner can have a vtable
2514-
#[test]
2513+
// Ensure that EcdsaChannelSigner can have a vtable - not required in bindings
2514+
/*#[test]
25152515
pub fn dyn_sign() {
25162516
let _signer: Box<dyn EcdsaChannelSigner>;
2517-
}
2517+
}*/
25182518

25192519
#[cfg(ldk_bench)]
25202520
pub mod benches {

0 commit comments

Comments
 (0)