Make ChannelMonitor clonable again
authorMatt Corallo <git@bluematt.me>
Mon, 1 Feb 2021 01:12:50 +0000 (20:12 -0500)
committerMatt Corallo <git@bluematt.me>
Thu, 11 Feb 2021 21:19:56 +0000 (16:19 -0500)
In general, we'd been moving away from ChannelMonitor being clonable,
   XXXXXXXXXXXXXXXXXXXx

lightning/src/chain/channelmonitor.rs
lightning/src/ln/onchaintx.rs

index 95495d1bf1334bb2381e6bf92b3485acf2f8ce09..cf9dc763529e310027b46795a32c2c940d32c933 100644 (file)
@@ -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<ChanSigner: ChannelKeys> {
        latest_update_id: u64,
        commitment_transaction_number_obscure_factor: u64,
index 2d7d417d255ac77dfecb1791dd24bca42d4166ca..c0cb2a2bc5b84d8e66429e6878190b9e459c64a1 100644 (file)
@@ -240,6 +240,7 @@ impl Writeable for Option<Vec<Option<(usize, Signature)>>> {
 
 /// OnchainTxHandler receives claiming requests, aggregates them if it's sound, broadcast and
 /// do RBF bumping if possible.
+#[derive(Clone)]
 pub struct OnchainTxHandler<ChanSigner: ChannelKeys> {
        destination_script: Script,
        holder_commitment: HolderCommitmentTransaction,