From 1fa6326c6cfb1aec0c13a38adc252f51c85e540e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 10 Oct 2021 00:10:38 +0000 Subject: [PATCH] TEST DROP ME --- lightning/src/ln/channel.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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())); } -- 2.39.5