X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmonitor.rs;fp=src%2Fln%2Fchannelmonitor.rs;h=0ba2f0ba452abc511e7eeb0d922822461d91cec3;hb=ea6e9a78802c672f67fd26de43a5cc6b95fcf693;hp=b1e7df29cddfa5bcd3a2394453310a97dbb1e176;hpb=7a483e597c9079a280b1ea31d9762d89300097ce;p=rust-lightning diff --git a/src/ln/channelmonitor.rs b/src/ln/channelmonitor.rs index b1e7df29..0ba2f0ba 100644 --- a/src/ln/channelmonitor.rs +++ b/src/ln/channelmonitor.rs @@ -1813,7 +1813,10 @@ impl ChannelMonitor { // to broadcast solving backward if let Some((source, payment_hash)) = payment_data { let mut payment_preimage = PaymentPreimage([0; 32]); - if input.witness.len() == 5 && input.witness[4].len() == ACCEPTED_HTLC_SCRIPT_WEIGHT { + if (input.witness.len() == 3 && input.witness[2].len() == OFFERED_HTLC_SCRIPT_WEIGHT && input.witness[1].len() == 33) + || (input.witness.len() == 3 && input.witness[2].len() == ACCEPTED_HTLC_SCRIPT_WEIGHT && input.witness[1].len() == 33) { + log_error!(self, "Remote used revocation sig to take a {} HTLC output at index {} from commitment_tx {}", if input.witness[2].len() == OFFERED_HTLC_SCRIPT_WEIGHT { "offered" } else { "accepted" }, input.previous_output.vout, input.previous_output.txid); + } else if input.witness.len() == 5 && input.witness[4].len() == ACCEPTED_HTLC_SCRIPT_WEIGHT { payment_preimage.0.copy_from_slice(&tx.input[0].witness[3]); htlc_updated.push((source, Some(payment_preimage), payment_hash)); } else if input.witness.len() == 3 && input.witness[2].len() == OFFERED_HTLC_SCRIPT_WEIGHT {