Skip to content

Commit a1d2a95

Browse files
committed
Be a bit more verbose in the _actions_deferred mon upd handler
In 99df17e we moved the "call style" argument out of `handle_new_monitor_update`, making each an individual macro instead. For the `REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER` call style, we renamed the macro `handle_new_monitor_update_actions_deferred`. That name doesn't really capture the requirements of that incredibly-awkward macro - namely that the actions need to be processed by the caller (rather than just being "deferred" and handled in some automated way later) and that the macro really should only be used when the callsite needs the peer state locks to remain locked, rather than being able to drop them to handle post-update actions. Here we rename it to the (mouthful) `handle_new_monitor_update_locked_actions_handled_by_caller`. Luckily its only used in two places.
1 parent f336450 commit a1d2a95

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,8 +3288,9 @@ macro_rules! locked_close_channel {
32883288
}};
32893289
($self: ident, $peer_state: expr, $funded_chan: expr, $shutdown_res_mut: expr, FUNDED) => {{
32903290
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3291-
handle_new_monitor_update_actions_deferred!($self, funding_txo, update, $peer_state,
3292-
$funded_chan.context);
3291+
handle_new_monitor_update_locked_actions_handled_by_caller!(
3292+
$self, funding_txo, update, $peer_state, $funded_chan.context
3293+
);
32933294
}
32943295
// If there's a possibility that we need to generate further monitor updates for this
32953296
// channel, we need to store the last update_id of it. However, we don't want to insert
@@ -3741,7 +3742,7 @@ macro_rules! handle_post_close_monitor_update {
37413742
/// drop the aforementioned peer state locks at a given callsite. In this situation, use this macro
37423743
/// to apply the monitor update immediately and handle the monitor update completion actions at a
37433744
/// later time.
3744-
macro_rules! handle_new_monitor_update_actions_deferred {
3745+
macro_rules! handle_new_monitor_update_locked_actions_handled_by_caller {
37453746
(
37463747
$self: ident, $funding_txo: expr, $update: expr, $peer_state: expr, $chan_context: expr
37473748
) => {{
@@ -14360,7 +14361,7 @@ where
1436014361
insert_short_channel_id!(short_to_chan_info, funded_channel);
1436114362

1436214363
if let Some(monitor_update) = monitor_update_opt {
14363-
handle_new_monitor_update_actions_deferred!(
14364+
handle_new_monitor_update_locked_actions_handled_by_caller!(
1436414365
self,
1436514366
funding_txo,
1436614367
monitor_update,

0 commit comments

Comments
 (0)