@@ -280,7 +280,7 @@ impl HolderSignedTx {
280
280
281
281
/// We use this to track static counterparty commitment transaction data and to generate any
282
282
/// justice or 2nd-stage preimage/timeout transactions.
283
- #[ derive( PartialEq , Eq ) ]
283
+ #[ derive( Clone , PartialEq , Eq ) ]
284
284
struct CounterpartyCommitmentParameters {
285
285
counterparty_delayed_payment_base_key : PublicKey ,
286
286
counterparty_htlc_base_key : PublicKey ,
@@ -334,7 +334,7 @@ impl Readable for CounterpartyCommitmentParameters {
334
334
/// observed, as well as the transaction causing it.
335
335
///
336
336
/// 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 ) ]
338
338
struct OnchainEventEntry {
339
339
txid : Txid ,
340
340
height : u32 ,
@@ -377,7 +377,7 @@ type CommitmentTxCounterpartyOutputInfo = Option<(u32, u64)>;
377
377
378
378
/// Upon discovering of some classes of onchain tx by ChannelMonitor, we may have to take actions on it
379
379
/// once they mature to enough confirmations (ANTI_REORG_DELAY)
380
- #[ derive( PartialEq , Eq ) ]
380
+ #[ derive( Clone , PartialEq , Eq ) ]
381
381
enum OnchainEvent {
382
382
/// An outbound HTLC failing after a transaction is confirmed. Used
383
383
/// * when an outbound HTLC output is spent by us after the HTLC timed out
@@ -682,7 +682,7 @@ impl Balance {
682
682
}
683
683
684
684
/// An HTLC which has been irrevocably resolved on-chain, and has reached ANTI_REORG_DELAY.
685
- #[ derive( PartialEq , Eq ) ]
685
+ #[ derive( Clone , PartialEq , Eq ) ]
686
686
struct IrrevocablyResolvedHTLC {
687
687
commitment_tx_output_idx : Option < u32 > ,
688
688
/// 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> {
750
750
pub ( super ) inner : Mutex < ChannelMonitorImpl < Signer > > ,
751
751
}
752
752
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 ) ]
754
761
pub ( crate ) struct ChannelMonitorImpl < Signer : WriteableEcdsaChannelSigner > {
755
762
latest_update_id : u64 ,
756
763
commitment_transaction_number_obscure_factor : u64 ,
0 commit comments