Skip to content

Commit a0cd76c

Browse files
committed
f - use early return instead of is_funding_tx_confirmed
1 parent fdf11cb commit a0cd76c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5053,8 +5053,6 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
50535053
},
50545054
};
50555055

5056-
let mut is_funding_tx_confirmed = false;
5057-
50585056
// Check if the transaction is the expected funding transaction, and if it is,
50595057
// check that it pays the right amount to the right script.
50605058
if funding.funding_tx_confirmation_height == 0 {
@@ -5102,13 +5100,13 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
51025100
Ok(scid) => Some(scid),
51035101
Err(_) => panic!("Block was bogus - either height was > 16 million, had > 16 million transactions, or had > 65k outputs"),
51045102
};
5105-
}
51065103

5107-
is_funding_tx_confirmed = true;
5104+
return Ok(true);
5105+
}
51085106
}
51095107
}
51105108

5111-
Ok(is_funding_tx_confirmed)
5109+
Ok(false)
51125110
}
51135111

51145112
fn check_for_funding_tx_spent<L: Deref>(

0 commit comments

Comments
 (0)