@@ -3645,6 +3645,44 @@ macro_rules! handle_initial_monitor {
3645
3645
};
3646
3646
}
3647
3647
3648
+ macro_rules! handle_post_close_monitor_update {
3649
+ (
3650
+ $self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3651
+ $per_peer_state_lock: expr, $counterparty_node_id: expr, $channel_id: expr
3652
+ ) => {{
3653
+ let logger =
3654
+ WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
3655
+ let in_flight_updates;
3656
+ let idx;
3657
+ handle_new_monitor_update!(
3658
+ $self,
3659
+ $funding_txo,
3660
+ $update,
3661
+ $peer_state,
3662
+ logger,
3663
+ $channel_id,
3664
+ $counterparty_node_id,
3665
+ in_flight_updates,
3666
+ idx,
3667
+ _internal_outer,
3668
+ {
3669
+ let _ = in_flight_updates.remove(idx);
3670
+ if in_flight_updates.is_empty() {
3671
+ let update_actions = $peer_state
3672
+ .monitor_update_blocked_actions
3673
+ .remove(&$channel_id)
3674
+ .unwrap_or(Vec::new());
3675
+
3676
+ mem::drop($peer_state_lock);
3677
+ mem::drop($per_peer_state_lock);
3678
+
3679
+ $self.handle_monitor_update_completion_actions(update_actions);
3680
+ }
3681
+ }
3682
+ )
3683
+ }};
3684
+ }
3685
+
3648
3686
macro_rules! handle_new_monitor_update {
3649
3687
(
3650
3688
$self: ident, $funding_txo: expr, $update: expr, $peer_state: expr, $logger: expr,
@@ -3719,41 +3757,6 @@ macro_rules! handle_new_monitor_update {
3719
3757
}
3720
3758
)
3721
3759
}};
3722
- (
3723
- $self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3724
- $per_peer_state_lock: expr, $counterparty_node_id: expr, $channel_id: expr, POST_CHANNEL_CLOSE
3725
- ) => {{
3726
- let logger =
3727
- WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
3728
- let in_flight_updates;
3729
- let idx;
3730
- handle_new_monitor_update!(
3731
- $self,
3732
- $funding_txo,
3733
- $update,
3734
- $peer_state,
3735
- logger,
3736
- $channel_id,
3737
- $counterparty_node_id,
3738
- in_flight_updates,
3739
- idx,
3740
- _internal_outer,
3741
- {
3742
- let _ = in_flight_updates.remove(idx);
3743
- if in_flight_updates.is_empty() {
3744
- let update_actions = $peer_state
3745
- .monitor_update_blocked_actions
3746
- .remove(&$channel_id)
3747
- .unwrap_or(Vec::new());
3748
-
3749
- mem::drop($peer_state_lock);
3750
- mem::drop($per_peer_state_lock);
3751
-
3752
- $self.handle_monitor_update_completion_actions(update_actions);
3753
- }
3754
- }
3755
- )
3756
- }};
3757
3760
(
3758
3761
$self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
3759
3762
$per_peer_state_lock: expr, $chan: expr
@@ -4464,9 +4467,9 @@ where
4464
4467
hash_map::Entry::Vacant(_) => {},
4465
4468
}
4466
4469
4467
- handle_new_monitor_update !(
4470
+ handle_post_close_monitor_update !(
4468
4471
self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state,
4469
- counterparty_node_id, channel_id, POST_CHANNEL_CLOSE
4472
+ counterparty_node_id, channel_id
4470
4473
);
4471
4474
}
4472
4475
@@ -8925,16 +8928,15 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8925
8928
.push(action);
8926
8929
}
8927
8930
8928
- handle_new_monitor_update !(
8931
+ handle_post_close_monitor_update !(
8929
8932
self,
8930
8933
prev_hop.funding_txo,
8931
8934
preimage_update,
8932
8935
peer_state_lock,
8933
8936
peer_state,
8934
8937
per_peer_state,
8935
8938
prev_hop.counterparty_node_id,
8936
- chan_id,
8937
- POST_CHANNEL_CLOSE
8939
+ chan_id
8938
8940
);
8939
8941
}
8940
8942
@@ -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