Skip to content

Commit dec719f

Browse files
committed
f comments
1 parent fd22aa0 commit dec719f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,15 @@ macro_rules! handle_chan_restoration_locked {
916916
macro_rules! handle_cs { () => {
917917
if let Some(monitor_update) = chanmon_update {
918918
assert!($order == RAACommitmentOrder::RevokeAndACKFirst);
919+
// We only ever broadcast a funding transaction in response to a funding_signed
920+
// message and the resulting monitor update. Thus, on channel_reestablish
921+
// message handling we can't have a funding transaction to broadcast. When
922+
// processing a monitor update finishing resulting in a funding broadcast, we
923+
// cannot have a second monitor update, thus this case would indicate a bug.
919924
assert!(funding_broadcastable.is_none());
925+
// Given we were just reconnected or finished updating a channel monitor, the
926+
// only case where we can get a new ChannelMonitorUpdate would be if we also
927+
// have some commitment updates to send as well.
920928
assert!($commitment_update.is_some());
921929
if let Err(e) = $self.chain_monitor.update_channel($channel_entry.get().get_funding_txo().unwrap(), monitor_update) {
922930
break handle_monitor_err!($self, e, $channel_state, $channel_entry, RAACommitmentOrder::CommitmentFirst, false, true);

0 commit comments

Comments
 (0)