Skip to content

Commit 64c47c5

Browse files
committed
Drop unnecessary scope in process_pending_htlcs_forwards
1 parent c437016 commit 64c47c5

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7070,25 +7070,23 @@ where
70707070
let mut new_events = VecDeque::new();
70717071
let mut failed_forwards = Vec::new();
70727072
let mut phantom_receives: Vec<PerSourcePendingForward> = Vec::new();
7073-
{
7074-
let mut forward_htlcs = new_hash_map();
7075-
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap());
7076-
7077-
for (short_chan_id, mut pending_forwards) in forward_htlcs {
7078-
if short_chan_id != 0 {
7079-
self.process_forward_htlcs(
7080-
short_chan_id,
7081-
&mut pending_forwards,
7082-
&mut failed_forwards,
7083-
&mut phantom_receives,
7084-
);
7085-
} else {
7086-
self.process_receive_htlcs(
7087-
&mut pending_forwards,
7088-
&mut new_events,
7089-
&mut failed_forwards,
7090-
);
7091-
}
7073+
let mut forward_htlcs = new_hash_map();
7074+
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap());
7075+
7076+
for (short_chan_id, mut pending_forwards) in forward_htlcs {
7077+
if short_chan_id != 0 {
7078+
self.process_forward_htlcs(
7079+
short_chan_id,
7080+
&mut pending_forwards,
7081+
&mut failed_forwards,
7082+
&mut phantom_receives,
7083+
);
7084+
} else {
7085+
self.process_receive_htlcs(
7086+
&mut pending_forwards,
7087+
&mut new_events,
7088+
&mut failed_forwards,
7089+
);
70927090
}
70937091
}
70947092

0 commit comments

Comments
 (0)