]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Log resolution of offered HTLC by HTLC-timeout tx
authorAntoine Riard <ariard@student.42.fr>
Sun, 30 Dec 2018 19:21:58 +0000 (14:21 -0500)
committerAntoine Riard <ariard@student.42.fr>
Thu, 3 Jan 2019 02:06:04 +0000 (21:06 -0500)
src/ln/channelmonitor.rs

index 5415fefec3057c7ec1809fa171864086e6d88742..4ebeba047585c109fe665fed1a6e6f68fe3c3b10 100644 (file)
@@ -1815,9 +1815,12 @@ impl ChannelMonitor {
                                        }
                                        if payment_data.is_none() {
                                                for htlc_output in $htlc_outputs {
-                                                       if input.previous_output.vout == htlc_output.transaction_output_index {
+                                                       if input.previous_output.vout == htlc_output.transaction_output_index && !htlc_output.offered {
                                                                log_info!(self, "Input spending {}:{} in {} resolves inbound HTLC with timeout from {}", input.previous_output.txid, input.previous_output.vout, tx.txid(), $source);
                                                                continue 'outer_loop;
+                                                       } else if input.previous_output.vout == htlc_output.transaction_output_index && tx.lock_time > 0 {
+                                                               log_info!(self, "Input spending {}:{} in {} resolves offered HTLC with HTLC-timeout from {}", input.previous_output.txid, input.previous_output.vout, tx.txid(), $source);
+                                                               continue 'outer_loop;
                                                        }
                                                }
                                        }