@@ -280,7 +280,7 @@ impl HolderSignedTx {
280280
281281/// We use this to track static counterparty commitment transaction data and to generate any
282282/// justice or 2nd-stage preimage/timeout transactions.
283- #[ derive( PartialEq , Eq ) ]
283+ #[ derive( Clone , PartialEq , Eq ) ]
284284struct CounterpartyCommitmentParameters {
285285 counterparty_delayed_payment_base_key : PublicKey ,
286286 counterparty_htlc_base_key : PublicKey ,
@@ -334,7 +334,7 @@ impl Readable for CounterpartyCommitmentParameters {
334334/// observed, as well as the transaction causing it.
335335///
336336/// Used to determine when the on-chain event can be considered safe from a chain reorganization.
337- #[ derive( PartialEq , Eq ) ]
337+ #[ derive( Clone , PartialEq , Eq ) ]
338338struct OnchainEventEntry {
339339 txid : Txid ,
340340 height : u32 ,
@@ -377,7 +377,7 @@ type CommitmentTxCounterpartyOutputInfo = Option<(u32, u64)>;
377377
378378/// Upon discovering of some classes of onchain tx by ChannelMonitor, we may have to take actions on it
379379/// once they mature to enough confirmations (ANTI_REORG_DELAY)
380- #[ derive( PartialEq , Eq ) ]
380+ #[ derive( Clone , PartialEq , Eq ) ]
381381enum OnchainEvent {
382382 /// An outbound HTLC failing after a transaction is confirmed. Used
383383 /// * when an outbound HTLC output is spent by us after the HTLC timed out
@@ -682,7 +682,7 @@ impl Balance {
682682}
683683
684684/// An HTLC which has been irrevocably resolved on-chain, and has reached ANTI_REORG_DELAY.
685- #[ derive( PartialEq , Eq ) ]
685+ #[ derive( Clone , PartialEq , Eq ) ]
686686struct IrrevocablyResolvedHTLC {
687687 commitment_tx_output_idx : Option < u32 > ,
688688 /// The txid of the transaction which resolved the HTLC, this may be a commitment (if the HTLC
@@ -750,7 +750,14 @@ pub struct ChannelMonitor<Signer: WriteableEcdsaChannelSigner> {
750750 pub ( super ) inner : Mutex < ChannelMonitorImpl < Signer > > ,
751751}
752752
753- #[ derive( PartialEq ) ]
753+ impl < Signer : WriteableEcdsaChannelSigner > Clone for ChannelMonitor < Signer > where Signer : Clone {
754+ fn clone ( & self ) -> Self {
755+ let inner = self . inner . lock ( ) . unwrap ( ) . clone ( ) ;
756+ ChannelMonitor :: from_impl ( inner)
757+ }
758+ }
759+
760+ #[ derive( Clone , PartialEq ) ]
754761pub ( crate ) struct ChannelMonitorImpl < Signer : WriteableEcdsaChannelSigner > {
755762 latest_update_id : u64 ,
756763 commitment_transaction_number_obscure_factor : u64 ,
0 commit comments