From 4a23f99ee96e0580f1786f4833d5b52a616c3489 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 31 Jan 2021 20:12:50 -0500 Subject: [PATCH] Make ChannelMonitor clonable again In general, we'd been moving away from ChannelMonitor being clonable, XXXXXXXXXXXXXXXXXXXx --- lightning/src/chain/channelmonitor.rs | 3 ++- lightning/src/ln/onchaintx.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 95495d1bf..cf9dc7635 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -267,7 +267,7 @@ struct HolderSignedTx { /// We use this to track counterparty commitment transactions and htlcs outputs and /// use it to generate any justice or 2nd-stage preimage/timeout transactions. -#[derive(PartialEq)] +#[derive(Clone, PartialEq)] struct CounterpartyCommitmentTransaction { counterparty_delayed_payment_base_key: PublicKey, counterparty_htlc_base_key: PublicKey, @@ -623,6 +623,7 @@ impl Readable for ChannelMonitorUpdateStep { /// the "reorg path" (ie disconnecting blocks until you find a common ancestor from both the /// returned block hash and the the current chain and then reconnecting blocks to get to the /// best chain) upon deserializing the object! +#[derive(Clone)] pub struct ChannelMonitor { latest_update_id: u64, commitment_transaction_number_obscure_factor: u64, diff --git a/lightning/src/ln/onchaintx.rs b/lightning/src/ln/onchaintx.rs index 2d7d417d2..c0cb2a2bc 100644 --- a/lightning/src/ln/onchaintx.rs +++ b/lightning/src/ln/onchaintx.rs @@ -240,6 +240,7 @@ impl Writeable for Option>> { /// OnchainTxHandler receives claiming requests, aggregates them if it's sound, broadcast and /// do RBF bumping if possible. +#[derive(Clone)] pub struct OnchainTxHandler { destination_script: Script, holder_commitment: HolderCommitmentTransaction, -- 2.39.5