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