Skip to content
Draft
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
20 changes: 20 additions & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ enum BackgroundEvent {
channel_id: ChannelId,
highest_update_id_completed: u64,
},
/// A channel had blocked monitor updates waiting on startup. If the updates were blocked on
/// an MPP claim blocker not written to disk, we may be able to unblock them now.
///
/// This event is never written to disk.
AttemptUnblockMonitorUpdates { counterparty_node_id: PublicKey, channel_id: ChannelId },
}

/// A pointer to a channel that is unblocked when an event is surfaced
Expand Down Expand Up @@ -8310,6 +8315,12 @@ impl<
&counterparty_node_id,
);
},
BackgroundEvent::AttemptUnblockMonitorUpdates {
counterparty_node_id,
channel_id,
} => {
self.handle_monitor_update_release(counterparty_node_id, channel_id, None);
},
}
}
NotifyOption::DoPersist
Expand Down Expand Up @@ -9598,6 +9609,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
channel_id, ..
} =>
*channel_id == prev_channel_id,
BackgroundEvent::AttemptUnblockMonitorUpdates { .. } => false,
}
});
assert!(
Expand Down Expand Up @@ -18664,6 +18676,14 @@ impl<
log_error!(logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/lightningdevkit/rust-lightning");
return Err(DecodeError::DangerousValue);
}
if funded_chan.blocked_monitor_updates_pending() > 0 {
pending_background_events.push(
BackgroundEvent::AttemptUnblockMonitorUpdates {
counterparty_node_id: *counterparty_id,
channel_id: *chan_id,
},
);
}
} else {
// We shouldn't have persisted (or read) any unfunded channel types so none should have been
// created in this `channel_by_id` map.
Expand Down