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);
5318
+
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);
5322
5319
Some(msgs::ChannelReady {
5323
5320
channel_id: self.context.channel_id(),
5324
5321
next_per_commitment_point,
@@ -5425,8 +5422,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);
5429
-
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.cur_holder_commitment_transaction_number + 2);
5425
+
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);
5426
+
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.holder_commitment_point.transaction_number() + 2);
5430
5427
msgs::RevokeAndACK {
5431
5428
channel_id: self.context.channel_id,
5432
5429
per_commitment_secret,
@@ -5559,7 +5556,7 @@ impl<SP: Deref> Channel<SP> where
5559
5556
return Err(ChannelError::Close("Peer sent an invalid channel_reestablish to force close in a non-standard way".to_owned()));
5560
5557
}
5561
5558
5562
-
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number - 1;
5559
+
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() - 1;
5563
5560
if msg.next_remote_commitment_number > 0 {
5564
5561
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);
5565
5562
let given_secret = SecretKey::from_slice(&msg.your_last_per_commitment_secret)
@@ -5621,7 +5618,7 @@ impl<SP: Deref> Channel<SP> where
5621
5618
}
5622
5619
5623
5620
// We have OurChannelReady set!
5624
-
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);
5621
+
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);
5625
5622
return Ok(ReestablishResponses {
5626
5623
channel_ready: Some(msgs::ChannelReady {
5627
5624
channel_id: self.context.channel_id(),
@@ -5664,9 +5661,9 @@ impl<SP: Deref> Channel<SP> where
5664
5661
}
5665
5662
let next_counterparty_commitment_number = INITIAL_COMMITMENT_NUMBER - self.context.cur_counterparty_commitment_transaction_number + if is_awaiting_remote_revoke { 1 } else { 0 };
5666
5663
5667
-
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number == 1 {
5664
+
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() == 1 {
5668
5665
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
5669
-
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);
5666
+
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);
5670
5667
Some(msgs::ChannelReady {
5671
5668
channel_id: self.context.channel_id(),
5672
5669
next_per_commitment_point,
@@ -6317,7 +6314,7 @@ impl<SP: Deref> Channel<SP> where
panic!("Cannot generate an open_channel after we've moved forward");
7613
7610
}
7614
7611
7615
-
if self.context.cur_holder_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER {
7612
+
if self.context.holder_commitment_point.transaction_number() != INITIAL_COMMITMENT_NUMBER {
7616
7613
panic!("Tried to send an open_channel for a channel that has already advanced");
7617
7614
}
7618
7615
7619
-
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);
7616
+
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);
8014
+
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