TEST DROP ME
authorMatt Corallo <git@bluematt.me>
Sun, 10 Oct 2021 00:10:38 +0000 (00:10 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Dec 2021 00:16:55 +0000 (00:16 +0000)
lightning/src/ln/channel.rs

index c6e365c5d56d608171f39d44e3bb534d8f4b2ed9..ad7cc8e3b065e922992b35f3ef8109a9f62ca3e1 100644 (file)
@@ -2114,6 +2114,13 @@ impl<Signer: Sign> Channel<Signer> {
                                                .map(|secret| SecretKey::from_slice(&secret).ok()).flatten()
                                                .map(|sk| PublicKey::from_secret_key(&self.secp_ctx, &sk))
                                };
+if self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1).is_some() {
+let cv = self.commitment_secrets.get_secret(INITIAL_COMMITMENT_NUMBER - 1)
+       .map(|secret| SecretKey::from_slice(&secret).ok()).flatten()
+       .map(|sk| PublicKey::from_secret_key(&self.secp_ctx, &sk));
+assert_eq!(cv, expected_point);
+panic!();
+}
                        if expected_point != Some(msg.next_per_commitment_point) {
                                return Err(ChannelError::Close("Peer sent a reconnect funding_locked with a different point".to_owned()));
                        }