Skip to content

Commit 8e48aa5

Browse files
committed
f simplify
1 parent b20e481 commit 8e48aa5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,11 +2951,9 @@ macro_rules! locked_close_channel {
29512951
} else {
29522952
let in_flight_updates = $peer_state.in_flight_monitor_updates.entry(funding_txo)
29532953
.or_insert_with(Vec::new);
2954-
in_flight_updates.iter().position(|upd| upd == &update)
2955-
.unwrap_or_else(|| {
2956-
in_flight_updates.push(update.clone());
2957-
0
2958-
});
2954+
if !in_flight_updates.contains(&update) {
2955+
in_flight_updates.push(update.clone());
2956+
}
29592957
let event = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
29602958
counterparty_node_id,
29612959
funding_txo,

0 commit comments

Comments
 (0)