let funding_redeemscript = self.get_funding_redeemscript();
let funding_txo_script = funding_redeemscript.to_v0_p2wsh();
let obscure_factor = get_commitment_transaction_number_obscure_factor(&self.get_holder_pubkeys().payment_point, &self.get_counterparty_pubkeys().payment_point, self.is_outbound());
- let mut channel_monitor = ChannelMonitor::new(self.secp_ctx.clone(), self.holder_signer.clone(),
- &self.shutdown_pubkey, self.get_holder_selected_contest_delay(),
- &self.destination_script, (funding_txo, funding_txo_script.clone()),
- &self.channel_transaction_parameters,
- funding_redeemscript.clone(), self.channel_value_satoshis,
- obscure_factor,
- holder_commitment_tx);
+ let channel_monitor = ChannelMonitor::new(self.secp_ctx.clone(), self.holder_signer.clone(),
+ &self.shutdown_pubkey, self.get_holder_selected_contest_delay(),
+ &self.destination_script, (funding_txo, funding_txo_script.clone()),
+ &self.channel_transaction_parameters,
+ funding_redeemscript.clone(), self.channel_value_satoshis,
+ obscure_factor,
+ holder_commitment_tx);
channel_monitor.provide_latest_counterparty_commitment_tx(counterparty_initial_commitment_txid, Vec::new(), self.cur_counterparty_commitment_transaction_number, self.counterparty_cur_commitment_point.unwrap(), logger);
let funding_txo = self.get_funding_txo().unwrap();
let funding_txo_script = funding_redeemscript.to_v0_p2wsh();
let obscure_factor = get_commitment_transaction_number_obscure_factor(&self.get_holder_pubkeys().payment_point, &self.get_counterparty_pubkeys().payment_point, self.is_outbound());
- let mut channel_monitor = ChannelMonitor::new(self.secp_ctx.clone(), self.holder_signer.clone(),
- &self.shutdown_pubkey, self.get_holder_selected_contest_delay(),
- &self.destination_script, (funding_txo, funding_txo_script),
- &self.channel_transaction_parameters,
- funding_redeemscript.clone(), self.channel_value_satoshis,
- obscure_factor,
- holder_commitment_tx);
+ let channel_monitor = ChannelMonitor::new(self.secp_ctx.clone(), self.holder_signer.clone(),
+ &self.shutdown_pubkey, self.get_holder_selected_contest_delay(),
+ &self.destination_script, (funding_txo, funding_txo_script),
+ &self.channel_transaction_parameters,
+ funding_redeemscript.clone(), self.channel_value_satoshis,
+ obscure_factor,
+ holder_commitment_tx);
channel_monitor.provide_latest_counterparty_commitment_tx(counterparty_initial_bitcoin_tx.txid, Vec::new(), self.cur_counterparty_commitment_transaction_number, self.counterparty_cur_commitment_point.unwrap(), logger);
// Upper bound by capacity. We make it a bit less than full capacity to prevent attempts
// to use full capacity. This is an effort to reduce routing failures, because in many cases
// channel might have been used to route very small values (either by honest users or as DoS).
- self.channel_value_satoshis * 9 / 10,
+ self.channel_value_satoshis * 1000 * 9 / 10,
Channel::<Signer>::get_holder_max_htlc_value_in_flight_msat(self.channel_value_satoshis)
);
signature = res.0;
htlc_signatures = res.1;
- log_trace!(logger, "Signed remote commitment tx {} with redeemscript {} -> {}",
+ log_trace!(logger, "Signed remote commitment tx {} (txid {}) with redeemscript {} -> {}",
+ encode::serialize_hex(&counterparty_commitment_tx.0.trust().built_transaction().transaction),
&counterparty_commitment_txid,
encode::serialize_hex(&self.get_funding_redeemscript()),
log_bytes!(signature.serialize_compact()[..]));