Skip to content

Commit 0d2836c

Browse files
committed
f reorder code blocks to improve legibility
1 parent 41232f5 commit 0d2836c

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
@@ -3650,13 +3650,14 @@ impl<Signer: Sign> Channel<Signer> {
36503650

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

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

36743671
Ok((None, timed_out_htlcs))

0 commit comments

Comments
 (0)