From: Matt Corallo Date: Mon, 1 Feb 2021 01:12:50 +0000 (-0500) Subject: Make ChannelMonitor clonable again X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4a23f99ee96e0580f1786f4833d5b52a616c3489;p=rust-lightning Make ChannelMonitor clonable again In general, we'd been moving away from ChannelMonitor being clonable, XXXXXXXXXXXXXXXXXXXx --- 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,