]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Correct txid logging to reverse bytes.
authorMatt Corallo <git@bluematt.me>
Sat, 20 Nov 2021 22:27:10 +0000 (22:27 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 20 Nov 2021 23:04:55 +0000 (23:04 +0000)
We also take this opportunity to log the channel being closed when
one is closed by an on-chain spend of the funding output.

lightning/src/chain/channelmonitor.rs

index 425a1890a8f46acfabd68773dbc32f51172e2676..d5664e453d42e7c7ae7d4268f12acba6b2e8c265 100644 (file)
@@ -2355,7 +2355,8 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
                                let prevout = &tx.input[0].previous_output;
                                if prevout.txid == self.funding_info.0.txid && prevout.vout == self.funding_info.0.index as u32 {
                                        let mut balance_spendable_csv = None;
-                                       log_info!(logger, "Channel closed by funding output spend in txid {}.", log_bytes!(tx.txid()));
+                                       log_info!(logger, "Channel {} closed by funding output spend in txid {}.",
+                                               log_bytes!(self.funding_info.0.to_channel_id()), tx.txid());
                                        if (tx.input[0].sequence >> 8*3) as u8 == 0x80 && (tx.lock_time >> 8*3) as u8 == 0x20 {
                                                let (mut new_outpoints, new_outputs) = self.check_spend_counterparty_transaction(&tx, height, &logger);
                                                if !new_outputs.1.is_empty() {