- let counterparty_tx_cache = CounterpartyCommitmentTransaction { counterparty_delayed_payment_base_key: *counterparty_delayed_payment_base_key, counterparty_htlc_base_key: *counterparty_htlc_base_key, on_counterparty_tx_csv, per_htlc: HashMap::new() };
-
- let mut onchain_tx_handler = OnchainTxHandler::new(destination_script.clone(), keys.clone(), on_holder_tx_csv);
-
- let holder_tx_sequence = initial_holder_commitment_tx.unsigned_tx.input[0].sequence as u64;
- let holder_tx_locktime = initial_holder_commitment_tx.unsigned_tx.lock_time as u64;
- let holder_commitment_tx = HolderSignedTx {
- txid: initial_holder_commitment_tx.txid(),
- revocation_key: initial_holder_commitment_tx.keys.revocation_key,
- a_htlc_key: initial_holder_commitment_tx.keys.broadcaster_htlc_key,
- b_htlc_key: initial_holder_commitment_tx.keys.countersignatory_htlc_key,
- delayed_payment_key: initial_holder_commitment_tx.keys.broadcaster_delayed_payment_key,
- per_commitment_point: initial_holder_commitment_tx.keys.per_commitment_point,
- feerate_per_kw: initial_holder_commitment_tx.feerate_per_kw,
- htlc_outputs: Vec::new(), // There are never any HTLCs in the initial commitment transactions
+ let counterparty_channel_parameters = channel_parameters.counterparty_parameters.as_ref().unwrap();
+ let counterparty_delayed_payment_base_key = counterparty_channel_parameters.pubkeys.delayed_payment_basepoint;
+ let counterparty_htlc_base_key = counterparty_channel_parameters.pubkeys.htlc_basepoint;
+ let counterparty_tx_cache = CounterpartyCommitmentTransaction { counterparty_delayed_payment_base_key, counterparty_htlc_base_key, on_counterparty_tx_csv, per_htlc: HashMap::new() };
+
+ let key_derivation_params = keys.key_derivation_params();
+ let holder_revocation_basepoint = keys.pubkeys().revocation_basepoint;
+ let mut onchain_tx_handler = OnchainTxHandler::new(destination_script.clone(), keys, channel_parameters.clone());
+
+ let secp_ctx = Secp256k1::new();
+
+ // block for Rust 1.34 compat
+ let (holder_commitment_tx, current_holder_commitment_number) = {
+ let trusted_tx = initial_holder_commitment_tx.trust();
+ let txid = trusted_tx.txid();
+
+ let tx_keys = trusted_tx.keys();
+ let holder_commitment_tx = HolderSignedTx {
+ txid,
+ revocation_key: tx_keys.revocation_key,
+ a_htlc_key: tx_keys.broadcaster_htlc_key,
+ b_htlc_key: tx_keys.countersignatory_htlc_key,
+ delayed_payment_key: tx_keys.broadcaster_delayed_payment_key,
+ per_commitment_point: tx_keys.per_commitment_point,
+ feerate_per_kw: trusted_tx.feerate_per_kw(),
+ htlc_outputs: Vec::new(), // There are never any HTLCs in the initial commitment transactions
+ };
+ (holder_commitment_tx, trusted_tx.commitment_number())