Skip to content

Commit

Permalink
Make ChannelMonitor always clonable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheBlueMatt committed Jan 23, 2024
1 parent 0c76767 commit 09673d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lightning/src/chain/channelmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lightning/src/sign/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

0 comments on commit 09673d5

Please sign in to comment.