Skip to content

Commit b588431

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 99df17e commit b588431

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
@@ -3684,7 +3684,7 @@ macro_rules! handle_post_close_monitor_update {
36843684
WithContext::from(&$self.logger, Some($counterparty_node_id), Some($channel_id), None);
36853685
let in_flight_updates;
36863686
let idx;
3687-
handle_new_monitor_update!(
3687+
handle_new_monitor_update_internal!(
36883688
$self,
36893689
$funding_txo,
36903690
$update,
@@ -3694,7 +3694,6 @@ macro_rules! handle_post_close_monitor_update {
36943694
$counterparty_node_id,
36953695
in_flight_updates,
36963696
idx,
3697-
_internal_outer,
36983697
{
36993698
let _ = in_flight_updates.remove(idx);
37003699
if in_flight_updates.is_empty() {
@@ -3731,7 +3730,7 @@ macro_rules! handle_new_monitor_update_actions_deferred {
37313730
let counterparty_node_id = $chan_context.get_counterparty_node_id();
37323731
let in_flight_updates;
37333732
let idx;
3734-
handle_new_monitor_update!(
3733+
handle_new_monitor_update_internal!(
37353734
$self,
37363735
$funding_txo,
37373736
$update,
@@ -3741,19 +3740,18 @@ macro_rules! handle_new_monitor_update_actions_deferred {
37413740
counterparty_node_id,
37423741
in_flight_updates,
37433742
idx,
3744-
_internal_outer,
37453743
{
37463744
let _ = in_flight_updates.remove(idx);
37473745
}
37483746
)
37493747
}};
37503748
}
37513749

3752-
macro_rules! handle_new_monitor_update {
3750+
macro_rules! handle_new_monitor_update_internal {
37533751
(
37543752
$self: ident, $funding_txo: expr, $update: expr, $peer_state: expr, $logger: expr,
37553753
$chan_id: expr, $counterparty_node_id: expr, $in_flight_updates: ident, $update_idx: ident,
3756-
_internal_outer, $completed: expr
3754+
$completed: expr
37573755
) => {{
37583756
$in_flight_updates = &mut $peer_state
37593757
.in_flight_monitor_updates
@@ -3798,6 +3796,9 @@ macro_rules! handle_new_monitor_update {
37983796
false
37993797
}
38003798
}};
3799+
}
3800+
3801+
macro_rules! handle_new_monitor_update {
38013802
(
38023803
$self: ident, $funding_txo: expr, $update: expr, $peer_state_lock: expr, $peer_state: expr,
38033804
$per_peer_state_lock: expr, $chan: expr
@@ -3807,7 +3808,7 @@ macro_rules! handle_new_monitor_update {
38073808
let counterparty_node_id = $chan.context.get_counterparty_node_id();
38083809
let in_flight_updates;
38093810
let idx;
3810-
handle_new_monitor_update!(
3811+
handle_new_monitor_update_internal!(
38113812
$self,
38123813
$funding_txo,
38133814
$update,
@@ -3817,7 +3818,6 @@ macro_rules! handle_new_monitor_update {
38173818
counterparty_node_id,
38183819
in_flight_updates,
38193820
idx,
3820-
_internal_outer,
38213821
{
38223822
let _ = in_flight_updates.remove(idx);
38233823
if in_flight_updates.is_empty() && $chan.blocked_monitor_updates_pending() == 0 {

0 commit comments

Comments
 (0)