Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lightning/src/ln/chanmon_update_fail_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3897,7 +3897,7 @@ fn do_test_durable_preimages_on_closed_channel(
}
}
if !close_chans_before_reload {
check_closed_broadcast(&nodes[1], 1, true);
check_closed_broadcast(&nodes[1], 1, false);
let reason = ClosureReason::CommitmentTxConfirmed;
check_closed_event(&nodes[1], 1, reason, false, &[node_a_id], 100000);
}
Expand All @@ -3914,7 +3914,7 @@ fn do_test_durable_preimages_on_closed_channel(
check_spends!(bs_preimage_tx, as_closing_tx[0]);

mine_transactions(&nodes[0], &[&as_closing_tx[0], bs_preimage_tx]);
check_closed_broadcast(&nodes[0], 1, true);
check_closed_broadcast(&nodes[0], 1, false);
expect_payment_sent(&nodes[0], payment_preimage, None, true, true);

if !close_chans_before_reload || close_only_a {
Expand Down Expand Up @@ -4063,7 +4063,7 @@ fn do_test_reload_mon_update_completion_actions(close_during_reload: bool) {
Event::ChannelClosed { .. } => {},
_ => panic!(),
}
check_closed_broadcast!(nodes[1], true);
check_closed_broadcast(&nodes[1], 1, false);
}

// Once we run event processing the monitor should free, check that it was indeed the B<->C
Expand Down
6 changes: 6 additions & 0 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3883,6 +3883,12 @@ where
self.is_usable() && !self.channel_state.is_peer_disconnected()
}

/// Returns true if the peer for this channel is currently connected and we're not waiting on
/// `channel_reestablish` messages to re-init the channel.
pub fn is_connected(&self) -> bool {
!self.channel_state.is_peer_disconnected()
}

/// Returns false if our last broadcasted channel_update message has the "channel disabled" bit set
pub fn is_enabled(&self) -> bool {
self.is_usable()
Expand Down
Loading
Loading