]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Clean up log warning in the event ChannelMonitor force-closed
authorMatt Corallo <git@bluematt.me>
Mon, 15 Mar 2021 03:26:15 +0000 (23:26 -0400)
committerMatt Corallo <git@bluematt.me>
Sat, 20 Mar 2021 02:57:31 +0000 (22:57 -0400)
lightning/src/chain/channelmonitor.rs

index 24dfc57b6265c638cabff1715cb83c818d764827..28b6da4722a7b4e3820541b30c89047d1e8e5cfe 100644 (file)
@@ -1501,8 +1501,13 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
                                        self.lockdown_from_offchain = true;
                                        if *should_broadcast {
                                                self.broadcast_latest_holder_commitment_txn(broadcaster, logger);
-                                       } else {
+                                       } else if !self.holder_tx_signed {
                                                log_error!(logger, "You have a toxic holder commitment transaction avaible in channel monitor, read comment in ChannelMonitor::get_latest_holder_commitment_txn to be informed of manual action to take");
+                                       } else {
+                                               // If we generated a MonitorEvent::CommitmentTxBroadcasted, the ChannelManager
+                                               // will still give us a ChannelForceClosed event with !should_broadcast, but we
+                                               // shouldn't print the scary warning above.
+                                               log_info!(logger, "Channel off-chain state closed after we broadcasted our latest commitment transaction.");
                                        }
                                }
                        }