You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
5326
+
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
5330
5327
Some(msgs::ChannelReady {
5331
5328
channel_id: self.context.channel_id(),
5332
5329
next_per_commitment_point,
@@ -5433,8 +5430,8 @@ impl<SP: Deref> Channel<SP> where
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
5437
-
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.cur_holder_commitment_transaction_number + 2);
5433
+
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
5434
+
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.holder_commitment_point.transaction_number() + 2);
5438
5435
msgs::RevokeAndACK {
5439
5436
channel_id: self.context.channel_id,
5440
5437
per_commitment_secret,
@@ -5567,7 +5564,7 @@ impl<SP: Deref> Channel<SP> where
5567
5564
return Err(ChannelError::Close("Peer sent an invalid channel_reestablish to force close in a non-standard way".to_owned()));
5568
5565
}
5569
5566
5570
-
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number - 1;
5567
+
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() - 1;
5571
5568
if msg.next_remote_commitment_number > 0 {
5572
5569
let expected_point = self.context.holder_signer.as_ref().get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - msg.next_remote_commitment_number + 1, &self.context.secp_ctx);
5573
5570
let given_secret = SecretKey::from_slice(&msg.your_last_per_commitment_secret)
@@ -5629,7 +5626,7 @@ impl<SP: Deref> Channel<SP> where
5629
5626
}
5630
5627
5631
5628
// We have OurChannelReady set!
5632
-
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
5629
+
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
5633
5630
return Ok(ReestablishResponses {
5634
5631
channel_ready: Some(msgs::ChannelReady {
5635
5632
channel_id: self.context.channel_id(),
@@ -5672,9 +5669,9 @@ impl<SP: Deref> Channel<SP> where
5672
5669
}
5673
5670
let next_counterparty_commitment_number = INITIAL_COMMITMENT_NUMBER - self.context.cur_counterparty_commitment_transaction_number + if is_awaiting_remote_revoke { 1 } else { 0 };
5674
5671
5675
-
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number == 1 {
5672
+
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() == 1 {
5676
5673
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
5677
-
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
5674
+
let next_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
5678
5675
Some(msgs::ChannelReady {
5679
5676
channel_id: self.context.channel_id(),
5680
5677
next_per_commitment_point,
@@ -6325,7 +6322,7 @@ impl<SP: Deref> Channel<SP> where
panic!("Cannot generate an open_channel after we've moved forward");
7623
7620
}
7624
7621
7625
-
if self.context.cur_holder_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER {
7622
+
if self.context.holder_commitment_point.transaction_number() != INITIAL_COMMITMENT_NUMBER {
7626
7623
panic!("Tried to send an open_channel for a channel that has already advanced");
7627
7624
}
7628
7625
7629
-
let first_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
7626
+
let first_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
let first_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.cur_holder_commitment_transaction_number, &self.context.secp_ctx);
8024
+
let first_per_commitment_point = self.context.holder_signer.as_ref().get_per_commitment_point(self.context.holder_commitment_point.transaction_number(), &self.context.secp_ctx);
0 commit comments