Skip to content

Commit b439094

Browse files
committed
f make if-block less awkward than me
1 parent 9e5ec7d commit b439094

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,11 +3494,7 @@ where
34943494
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
34953495
let peer_state = &mut *peer_state_lock;
34963496
for channel_id in channel_ids {
3497-
let context = if let Some(channel) = peer_state.inbound_v1_channel_by_id.get_mut(channel_id) {
3498-
&mut channel.context
3499-
} else if let Some(channel) = peer_state.outbound_v1_channel_by_id.get_mut(channel_id) {
3500-
&mut channel.context
3501-
} else if let Some(channel) = peer_state.channel_by_id.get_mut(channel_id) {
3497+
if let Some(channel) = peer_state.channel_by_id.get_mut(channel_id) {
35023498
let mut config = channel.context.config();
35033499
config.apply(config_update);
35043500
if !channel.context.update_config(&config) {
@@ -3513,6 +3509,12 @@ where
35133509
});
35143510
}
35153511
continue;
3512+
}
3513+
3514+
let context = if let Some(channel) = peer_state.inbound_v1_channel_by_id.get_mut(channel_id) {
3515+
&mut channel.context
3516+
} else if let Some(channel) = peer_state.outbound_v1_channel_by_id.get_mut(channel_id) {
3517+
&mut channel.context
35163518
} else {
35173519
return Err(APIError::ChannelUnavailable {
35183520
err: format!("Channel with ID {} was not found for the passed counterparty_node_id {}", log_bytes!(*channel_id), counterparty_node_id),

0 commit comments

Comments
 (0)