From: Matt Corallo Date: Sun, 10 Oct 2021 00:10:38 +0000 (+0000) Subject: TEST DROP ME X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1fa6326c6cfb1aec0c13a38adc252f51c85e540e;p=rust-lightning TEST DROP ME --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index c6e365c5d..ad7cc8e3b 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -2114,6 +2114,13 @@ impl Channel { .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())); }