}
// Then, try to find revoked htlc outputs
- if let Some(ref per_commitment_data) = per_commitment_option {
- for (_, &(ref htlc, _)) in per_commitment_data.iter().enumerate() {
+ if let Some(per_commitment_claimable_data) = per_commitment_option {
+ for (htlc, _) in per_commitment_claimable_data {
if let Some(transaction_output_index) = htlc.transaction_output_index {
if transaction_output_index as usize >= tx.output.len() ||
- tx.output[transaction_output_index as usize].value != htlc.amount_msat / 1000 {
+ tx.output[transaction_output_index as usize].value != htlc.to_bitcoin_amount() {
// per_commitment_data is corrupt or our commitment signing key leaked!
return (claimable_outpoints, (commitment_txid, watch_outputs),
to_counterparty_output_info);