Skip to content

Commit 12f06c3

Browse files
committed
Simplify ChannelState checks
1 parent 178c9ee commit 12f06c3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,11 +2389,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
23892389
// funding transaction, don't return a funding txo (which prevents providing the
23902390
// monitor update to the user, even if we return one).
23912391
// See test_duplicate_chan_id and test_pre_lockin_no_chan_closed_update for more.
2392-
let generate_monitor_update = match self.channel_state {
2393-
ChannelState::AwaitingChannelReady(_)|ChannelState::ChannelReady(_)|ChannelState::ShutdownComplete => true,
2394-
_ => false,
2395-
};
2396-
if generate_monitor_update {
2392+
if !self.channel_state.is_pre_funded_state() {
23972393
self.latest_monitor_update_id = CLOSED_CHANNEL_UPDATE_ID;
23982394
Some((self.get_counterparty_node_id(), funding_txo, ChannelMonitorUpdate {
23992395
update_id: self.latest_monitor_update_id,

0 commit comments

Comments
 (0)