@@ -3675,6 +3675,44 @@ macro_rules! handle_initial_monitor {
3675
3675
};
3676
3676
}
3677
3677
3678
+ macro_rules! handle_post_close_monitor_update {
3679
+ (
3680
+ $self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3681
+ $per_peer_state_lock: expr, $counterparty_node_id: expr, $channel_id: expr
3682
+ ) => {{
3683
+ let logger =
3684
+ WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
3685
+ let in_flight_updates;
3686
+ let idx;
3687
+ handle_new_monitor_update!(
3688
+ $self,
3689
+ $funding_txo,
3690
+ $update,
3691
+ $peer_state,
3692
+ logger,
3693
+ $channel_id,
3694
+ $counterparty_node_id,
3695
+ in_flight_updates,
3696
+ idx,
3697
+ _internal_outer,
3698
+ {
3699
+ let _ = in_flight_updates.remove(idx);
3700
+ if in_flight_updates.is_empty() {
3701
+ let update_actions = $peer_state
3702
+ .monitor_update_blocked_actions
3703
+ .remove(&$channel_id)
3704
+ .unwrap_or(Vec::new());
3705
+
3706
+ mem::drop($peer_state_lock);
3707
+ mem::drop($per_peer_state_lock);
3708
+
3709
+ $self.handle_monitor_update_completion_actions(update_actions);
3710
+ }
3711
+ }
3712
+ )
3713
+ }};
3714
+ }
3715
+
3678
3716
macro_rules! handle_new_monitor_update {
3679
3717
(
3680
3718
$self: ident, $funding_txo: expr, $update: expr, $peer_state: expr, $logger: expr,
@@ -3749,41 +3787,6 @@ macro_rules! handle_new_monitor_update {
3749
3787
}
3750
3788
)
3751
3789
}};
3752
- (
3753
- $self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3754
- $per_peer_state_lock: expr, $counterparty_node_id: expr, $channel_id: expr, POST_CHANNEL_CLOSE
3755
- ) => {{
3756
- let logger =
3757
- WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
3758
- let in_flight_updates;
3759
- let idx;
3760
- handle_new_monitor_update!(
3761
- $self,
3762
- $funding_txo,
3763
- $update,
3764
- $peer_state,
3765
- logger,
3766
- $channel_id,
3767
- $counterparty_node_id,
3768
- in_flight_updates,
3769
- idx,
3770
- _internal_outer,
3771
- {
3772
- let _ = in_flight_updates.remove(idx);
3773
- if in_flight_updates.is_empty() {
3774
- let update_actions = $peer_state
3775
- .monitor_update_blocked_actions
3776
- .remove(&$channel_id)
3777
- .unwrap_or(Vec::new());
3778
-
3779
- mem::drop($peer_state_lock);
3780
- mem::drop($per_peer_state_lock);
3781
-
3782
- $self.handle_monitor_update_completion_actions(update_actions);
3783
- }
3784
- }
3785
- )
3786
- }};
3787
3790
(
3788
3791
$self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3789
3792
$per_peer_state_lock: expr, $chan: expr
@@ -4494,9 +4497,9 @@ where
4494
4497
hash_map::Entry::Vacant(_) => {},
4495
4498
}
4496
4499
4497
- handle_new_monitor_update !(
4500
+ handle_post_close_monitor_update !(
4498
4501
self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state,
4499
- counterparty_node_id, channel_id, POST_CHANNEL_CLOSE
4502
+ counterparty_node_id, channel_id
4500
4503
);
4501
4504
}
4502
4505
@@ -8955,16 +8958,15 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8955
8958
.push(action);
8956
8959
}
8957
8960
8958
- handle_new_monitor_update !(
8961
+ handle_post_close_monitor_update !(
8959
8962
self,
8960
8963
prev_hop.funding_txo,
8961
8964
preimage_update,
8962
8965
peer_state_lock,
8963
8966
peer_state,
8964
8967
per_peer_state,
8965
8968
prev_hop.counterparty_node_id,
8966
- chan_id,
8967
- POST_CHANNEL_CLOSE
8969
+ chan_id
8968
8970
);
8969
8971
}
8970
8972
@@ -13345,16 +13347,15 @@ where
13345
13347
};
13346
13348
self.pending_background_events.lock().unwrap().push(event);
13347
13349
} else {
13348
- handle_new_monitor_update !(
13350
+ handle_post_close_monitor_update !(
13349
13351
self,
13350
13352
channel_funding_outpoint,
13351
13353
update,
13352
13354
peer_state,
13353
13355
peer_state,
13354
13356
per_peer_state,
13355
13357
counterparty_node_id,
13356
- channel_id,
13357
- POST_CHANNEL_CLOSE
13358
+ channel_id
13358
13359
);
13359
13360
}
13360
13361
},
0 commit comments