Skip to content

Commit 57d0422

Browse files
Extract _internal macro for new mon update handling
Finishes work over the past few commits of breaking up the handle_new_monitor_update macro.
1 parent bc64c82 commit 57d0422

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,7 +3654,7 @@ macro_rules! handle_post_close_monitor_update {
36543654
WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
36553655
let in_flight_updates;
36563656
let idx;
3657-
handle_new_monitor_update!(
3657+
handle_new_monitor_update_internal!(
36583658
$self,
36593659
$funding_txo,
36603660
$update,
@@ -3664,7 +3664,6 @@ macro_rules! handle_post_close_monitor_update {
36643664
$counterparty_node_id,
36653665
in_flight_updates,
36663666
idx,
3667-
_internal_outer,
36683667
{
36693668
let _ = in_flight_updates.remove(idx);
36703669
if in_flight_updates.is_empty() {
@@ -3701,7 +3700,7 @@ macro_rules! handle_new_monitor_update_actions_processed_later {
37013700
let counterparty_node_id = $chan_context.get_counterparty_node_id();
37023701
let in_flight_updates;
37033702
let idx;
3704-
handle_new_monitor_update!(
3703+
handle_new_monitor_update_internal!(
37053704
$self,
37063705
$funding_txo,
37073706
$update,
@@ -3711,19 +3710,18 @@ macro_rules! handle_new_monitor_update_actions_processed_later {
37113710
counterparty_node_id,
37123711
in_flight_updates,
37133712
idx,
3714-
_internal_outer,
37153713
{
37163714
let _ = in_flight_updates.remove(idx);
37173715
}
37183716
)
37193717
}};
37203718
}
37213719

3722-
macro_rules! handle_new_monitor_update {
3720+
macro_rules! handle_new_monitor_update_internal {
37233721
(
37243722
$self: ident, $funding_txo: expr, $update: expr, $peer_state: expr, $logger: expr,
37253723
$chan_id: expr, $counterparty_node_id: expr, $in_flight_updates: ident, $update_idx: ident,
3726-
_internal_outer, $completed: expr
3724+
$completed: expr
37273725
) => {{
37283726
$in_flight_updates = &mut $peer_state
37293727
.in_flight_monitor_updates
@@ -3768,6 +3766,9 @@ macro_rules! handle_new_monitor_update {
37683766
false
37693767
}
37703768
}};
3769+
}
3770+
3771+
macro_rules! handle_new_monitor_update {
37713772
(
37723773
$self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
37733774
$per_peer_state_lock: expr, $chan: expr
@@ -3777,7 +3778,7 @@ macro_rules! handle_new_monitor_update {
37773778
let counterparty_node_id = $chan.context.get_counterparty_node_id();
37783779
let in_flight_updates;
37793780
let idx;
3780-
handle_new_monitor_update!(
3781+
handle_new_monitor_update_internal!(
37813782
$self,
37823783
$funding_txo,
37833784
$update,
@@ -3787,7 +3788,6 @@ macro_rules! handle_new_monitor_update {
37873788
counterparty_node_id,
37883789
in_flight_updates,
37893790
idx,
3790-
_internal_outer,
37913791
{
37923792
let _ = in_flight_updates.remove(idx);
37933793
if in_flight_updates.is_empty() && $chan.blocked_monitor_updates_pending() == 0 {

0 commit comments

Comments
 (0)