Skip to content

Commit e589bbd

Browse files
committed
f unwrap the whole thing
1 parent 147fead commit e589bbd

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
@@ -2193,9 +2193,9 @@ impl<Signer: Sign> Channel<Signer> {
21932193
} else {
21942194
// If they have sent updated points, funding_locked is always supposed to match
21952195
// their "first" point, which we re-derive here.
2196-
self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1)
2197-
.map(|secret| SecretKey::from_slice(&secret).ok()).flatten()
2198-
.map(|sk| PublicKey::from_secret_key(&self.secp_ctx, &sk))
2196+
Some(PublicKey::from_secret_key(&self.secp_ctx, &SecretKey::from_slice(
2197+
&self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1).expect("We should have all prev secrets available")
2198+
).expect("We already advanced, so previous secret keys should have been validated already")))
21992199
};
22002200
if expected_point != Some(msg.next_per_commitment_point) {
22012201
return Err(ChannelError::Close("Peer sent a reconnect funding_locked with a different point".to_owned()));

0 commit comments

Comments
 (0)