Skip to content

Commit 090930c

Browse files
Merge pull request #4520 from TheBlueMatt/2026-03-startup-mpp-unblock
Attempt to unblock blocked monitor updates on startup
2 parents 265e976 + 01d55dc commit 090930c

2 files changed

Lines changed: 372 additions & 0 deletions

File tree

lightning/src/ln/channelmanager.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,11 @@ enum BackgroundEvent {
14721472
channel_id: ChannelId,
14731473
highest_update_id_completed: u64,
14741474
},
1475+
/// A channel had blocked monitor updates waiting on startup. If the updates were blocked on
1476+
/// an MPP claim blocker not written to disk, we may be able to unblock them now.
1477+
///
1478+
/// This event is never written to disk.
1479+
AttemptUnblockMonitorUpdates { counterparty_node_id: PublicKey, channel_id: ChannelId },
14751480
}
14761481

14771482
/// A pointer to a channel that is unblocked when an event is surfaced
@@ -8779,6 +8784,12 @@ impl<
87798784
&counterparty_node_id,
87808785
);
87818786
},
8787+
BackgroundEvent::AttemptUnblockMonitorUpdates {
8788+
counterparty_node_id,
8789+
channel_id,
8790+
} => {
8791+
self.handle_monitor_update_release(counterparty_node_id, channel_id, None);
8792+
},
87828793
}
87838794
}
87848795
NotifyOption::DoPersist
@@ -9735,6 +9746,7 @@ impl<
97359746
BackgroundEvent::MonitorUpdatesComplete {
97369747
channel_id, ..
97379748
} => *channel_id == _prev_channel_id,
9749+
BackgroundEvent::AttemptUnblockMonitorUpdates { .. } => false,
97389750
}
97399751
});
97409752
assert!(channel_closed || matching_bg_event, "{:?}", *background_events);
@@ -19554,6 +19566,14 @@ impl<
1955419566
log_error!(logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/lightningdevkit/rust-lightning");
1955519567
return Err(DecodeError::DangerousValue);
1955619568
}
19569+
if funded_chan.blocked_monitor_updates_pending() > 0 {
19570+
pending_background_events.push(
19571+
BackgroundEvent::AttemptUnblockMonitorUpdates {
19572+
counterparty_node_id: *counterparty_id,
19573+
channel_id: *chan_id,
19574+
},
19575+
);
19576+
}
1955719577
} else {
1955819578
// We shouldn't have persisted (or read) any unfunded channel types so none should have been
1955919579
// created in this `channel_by_id` map.

0 commit comments

Comments
 (0)