From de5266c4e5b712a822ee489e658eee9417e3dac4 Mon Sep 17 00:00:00 2001 From: QPotato Date: Wed, 20 Jul 2022 00:50:23 -0300 Subject: [PATCH] Remove second reference to toxic holder commitment txn but keeping the info log in the case the txn is already signed. --- lightning/src/chain/channelmonitor.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 86ecfc7bc6b..1dc31f8e083 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -2035,19 +2035,11 @@ impl ChannelMonitorImpl { ChannelMonitorUpdateStep::ChannelForceClosed { should_broadcast } => { log_trace!(logger, "Updating ChannelMonitor: channel force closed, should broadcast: {}", should_broadcast); self.lockdown_from_offchain = true; - if *should_broadcast { - self.maybe_broadcast_latest_holder_commitment_txn(broadcaster, logger); - } else { - self.allow_automated_broadcast = false; - 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::CommitmentTxConfirmed, 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."); - } + self.allow_automated_broadcast = *should_broadcast; + if !*should_broadcast && self.holder_tx_signed { + log_info!(logger, "Channel off-chain state closed after we broadcasted our latest commitment transaction."); } + self.maybe_broadcast_latest_holder_commitment_txn(broadcaster, logger); }, ChannelMonitorUpdateStep::ShutdownScript { scriptpubkey } => { log_trace!(logger, "Updating ChannelMonitor with shutdown script");