Skip to content

Commit 4619e24

Browse files
committed
Apply some upstream rustfmt in handle_monitor_update_completion
This aligns `handle_monitor_update_completion` closer with upstream after backporting 8f4a4d2, making potential future backports somewhat simpler.
1 parent 8dbdd15 commit 4619e24

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,10 +3574,16 @@ macro_rules! handle_monitor_update_completion {
35743574
$self.handle_monitor_update_completion_actions(update_actions);
35753575
} else {
35763576
log_debug!(logger, "Channel is open and awaiting update, resuming it");
3577-
let mut updates = $chan.monitor_updating_restored(&&logger,
3578-
&$self.node_signer, $self.chain_hash, &*$self.config.read().unwrap(),
3577+
let mut updates = $chan.monitor_updating_restored(
3578+
&&logger,
3579+
&$self.node_signer,
3580+
$self.chain_hash,
3581+
&*$self.config.read().unwrap(),
35793582
$self.best_block.read().unwrap().height,
3580-
|htlc_id| $self.path_for_release_held_htlc(htlc_id, outbound_scid_alias, &channel_id, &counterparty_node_id));
3583+
|htlc_id| {
3584+
$self.path_for_release_held_htlc(htlc_id, outbound_scid_alias, &channel_id, &counterparty_node_id)
3585+
},
3586+
);
35813587
let channel_update = if updates.channel_ready.is_some()
35823588
&& $chan.context.is_usable()
35833589
&& $peer_state.is_connected
@@ -3588,28 +3594,38 @@ macro_rules! handle_monitor_update_completion {
35883594
// channels, but there's no reason not to just inform our counterparty of our fees
35893595
// now.
35903596
if let Ok(msg) = $self.get_channel_update_for_unicast($chan) {
3591-
Some(MessageSendEvent::SendChannelUpdate {
3592-
node_id: counterparty_node_id,
3593-
msg,
3594-
})
3595-
} else { None }
3596-
} else { None };
3597+
Some(MessageSendEvent::SendChannelUpdate { node_id: counterparty_node_id, msg })
3598+
} else {
3599+
None
3600+
}
3601+
} else {
3602+
None
3603+
};
35973604

35983605
let (htlc_forwards, decode_update_add_htlcs) = $self.handle_channel_resumption(
3599-
&mut $peer_state.pending_msg_events, $chan, updates.raa,
3600-
updates.commitment_update, updates.commitment_order, updates.accepted_htlcs,
3601-
updates.pending_update_adds, updates.funding_broadcastable, updates.channel_ready,
3602-
updates.announcement_sigs, updates.tx_signatures, None, updates.channel_ready_order,
3606+
&mut $peer_state.pending_msg_events,
3607+
$chan,
3608+
updates.raa,
3609+
updates.commitment_update,
3610+
updates.commitment_order,
3611+
updates.accepted_htlcs,
3612+
updates.pending_update_adds,
3613+
updates.funding_broadcastable,
3614+
updates.channel_ready,
3615+
updates.announcement_sigs,
3616+
updates.tx_signatures,
3617+
None,
3618+
updates.channel_ready_order,
36033619
);
36043620
if let Some(upd) = channel_update {
36053621
$peer_state.pending_msg_events.push(upd);
36063622
}
36073623

3608-
let unbroadcasted_batch_funding_txid = $chan.context.unbroadcasted_batch_funding_txid(&$chan.funding);
3624+
let unbroadcasted_batch_funding_txid =
3625+
$chan.context.unbroadcasted_batch_funding_txid(&$chan.funding);
36093626
core::mem::drop($peer_state_lock);
36103627
core::mem::drop($per_peer_state_lock);
36113628

3612-
36133629
// If the channel belongs to a batch funding transaction, the progress of the batch
36143630
// should be updated as we have received funding_signed and persisted the monitor.
36153631
if let Some(txid) = unbroadcasted_batch_funding_txid {

0 commit comments

Comments
 (0)