Cache funding_redeemscript in OnchainTxHandler
[rust-lightning] / lightning / src / ln / channelmonitor.rs
index 8b116b9d63fc7ab68dfcf2a26a8ffbc3d076f948..6855ac15a77e9ad163921995169ea4e903f2dd09 100644 (file)
@@ -1098,7 +1098,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
                        onchain_detection: onchain_detection,
                        their_htlc_base_key: Some(their_htlc_base_key.clone()),
                        their_delayed_payment_base_key: Some(their_delayed_payment_base_key.clone()),
-                       funding_redeemscript: Some(funding_redeemscript),
+                       funding_redeemscript: Some(funding_redeemscript.clone()),
                        channel_value_satoshis: Some(channel_value_satoshis),
                        their_cur_revocation_points: None,
 
@@ -1121,7 +1121,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
                        onchain_events_waiting_threshold_conf: HashMap::new(),
                        outputs_to_watch: HashMap::new(),
 
-                       onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, logger.clone()),
+                       onchain_tx_handler: OnchainTxHandler::new(destination_script.clone(), keys, funding_redeemscript, logger.clone()),
 
                        last_block_hash: Default::default(),
                        secp_ctx: Secp256k1::new(),