Skip to content

Commit 4170bba

Browse files
committed
f reorder code blocks to improve legibility
1 parent 261d934 commit 4170bba

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,13 +3649,14 @@ impl<Signer: Sign> Channel<Signer> {
36493649

36503650
self.update_time_counter = cmp::max(self.update_time_counter, highest_header_time);
36513651

3652+
if let Some(funding_locked) = self.check_get_funding_locked(height) {
3653+
return Ok((Some(funding_locked), timed_out_htlcs));
3654+
}
3655+
36523656
if self.funding_tx_confirmation_height > 0 {
36533657
let funding_tx_confirmations = height as i64 - self.funding_tx_confirmation_height as i64 + 1;
3654-
if funding_tx_confirmations <= 0 {
3655-
self.funding_tx_confirmation_height = 0;
3656-
}
3657-
36583658
let non_shutdown_state = self.channel_state & (!MULTI_STATE_FLAGS);
3659+
36593660
if (non_shutdown_state >= ChannelState::ChannelFunded as u32 ||
36603661
(non_shutdown_state & ChannelState::OurFundingLocked as u32) == ChannelState::OurFundingLocked as u32) &&
36613662
funding_tx_confirmations < self.minimum_depth as i64 / 2 {
@@ -3664,10 +3665,6 @@ impl<Signer: Sign> Channel<Signer> {
36643665
data: format!("Funding transaction was un-confirmed. Locked at {} confs, now have {} confs.", self.minimum_depth, funding_tx_confirmations),
36653666
});
36663667
}
3667-
3668-
if let Some(funding_locked) = self.check_get_funding_locked(height) {
3669-
return Ok((Some(funding_locked), timed_out_htlcs));
3670-
}
36713668
}
36723669

36733670
Ok((None, timed_out_htlcs))

0 commit comments

Comments
 (0)