Skip to content

Commit 2af80ad

Browse files
committed
f unwrap the whole thing
1 parent da222b7 commit 2af80ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,9 +2203,9 @@ impl<Signer: Sign> Channel<Signer> {
22032203
} else {
22042204
// If they have sent updated points, funding_locked is always supposed to match
22052205
// their "first" point, which we re-derive here.
2206-
self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1)
2207-
.map(|secret| SecretKey::from_slice(&secret).ok()).flatten()
2208-
.map(|sk| PublicKey::from_secret_key(&self.secp_ctx, &sk))
2206+
Some(PublicKey::from_secret_key(&self.secp_ctx, &SecretKey::from_slice(
2207+
&self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1).expect("We should have all prev secrets available")
2208+
).expect("We already advanced, so previous secret keys should have been validated already")))
22092209
};
22102210
if expected_point != Some(msg.next_per_commitment_point) {
22112211
return Err(ChannelError::Close("Peer sent a reconnect funding_locked with a different point".to_owned()));

0 commit comments

Comments
 (0)