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);
5309
+
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);
5313
5310
Some(msgs::ChannelReady {
5314
5311
channel_id: self.context.channel_id(),
5315
5312
next_per_commitment_point,
@@ -5416,8 +5413,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);
5420
-
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.cur_holder_commitment_transaction_number + 2);
5416
+
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);
5417
+
let per_commitment_secret = self.context.holder_signer.as_ref().release_commitment_secret(self.context.holder_commitment_point.transaction_number() + 2);
5421
5418
msgs::RevokeAndACK {
5422
5419
channel_id: self.context.channel_id,
5423
5420
per_commitment_secret,
@@ -5550,7 +5547,7 @@ impl<SP: Deref> Channel<SP> where
5550
5547
return Err(ChannelError::Close("Peer sent an invalid channel_reestablish to force close in a non-standard way".to_owned()));
5551
5548
}
5552
5549
5553
-
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number - 1;
5550
+
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() - 1;
5554
5551
if msg.next_remote_commitment_number > 0 {
5555
5552
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);
5556
5553
let given_secret = SecretKey::from_slice(&msg.your_last_per_commitment_secret)
@@ -5612,7 +5609,7 @@ impl<SP: Deref> Channel<SP> where
5612
5609
}
5613
5610
5614
5611
// We have OurChannelReady set!
5615
-
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);
5612
+
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);
5616
5613
return Ok(ReestablishResponses {
5617
5614
channel_ready: Some(msgs::ChannelReady {
5618
5615
channel_id: self.context.channel_id(),
@@ -5655,9 +5652,9 @@ impl<SP: Deref> Channel<SP> where
5655
5652
}
5656
5653
let next_counterparty_commitment_number = INITIAL_COMMITMENT_NUMBER - self.context.cur_counterparty_commitment_transaction_number + if is_awaiting_remote_revoke { 1 } else { 0 };
5657
5654
5658
-
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.cur_holder_commitment_transaction_number == 1 {
5655
+
let channel_ready = if msg.next_local_commitment_number == 1 && INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() == 1 {
5659
5656
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
5660
-
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);
5657
+
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);
5661
5658
Some(msgs::ChannelReady {
5662
5659
channel_id: self.context.channel_id(),
5663
5660
next_per_commitment_point,
@@ -6308,7 +6305,7 @@ impl<SP: Deref> Channel<SP> where
panic!("Cannot generate an open_channel after we've moved forward");
7604
7601
}
7605
7602
7606
-
if self.context.cur_holder_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER {
7603
+
if self.context.holder_commitment_point.transaction_number() != INITIAL_COMMITMENT_NUMBER {
7607
7604
panic!("Tried to send an open_channel for a channel that has already advanced");
7608
7605
}
7609
7606
7610
-
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);
7607
+
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);
8005
+
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