@@ -2644,7 +2644,7 @@ where
2644
2644
is_batch_funding: Option<()>,
2645
2645
2646
2646
counterparty_next_commitment_point: Option<PublicKey>,
2647
- counterparty_prev_commitment_point : Option<PublicKey>,
2647
+ counterparty_current_commitment_point : Option<PublicKey>,
2648
2648
counterparty_node_id: PublicKey,
2649
2649
2650
2650
counterparty_shutdown_scriptpubkey: Option<ScriptBuf>,
@@ -3276,7 +3276,7 @@ where
3276
3276
is_batch_funding: None,
3277
3277
3278
3278
counterparty_next_commitment_point: Some(open_channel_fields.first_per_commitment_point),
3279
- counterparty_prev_commitment_point : None,
3279
+ counterparty_current_commitment_point : None,
3280
3280
counterparty_node_id,
3281
3281
3282
3282
counterparty_shutdown_scriptpubkey,
@@ -3516,7 +3516,7 @@ where
3516
3516
is_batch_funding: None,
3517
3517
3518
3518
counterparty_next_commitment_point: None,
3519
- counterparty_prev_commitment_point : None,
3519
+ counterparty_current_commitment_point : None,
3520
3520
counterparty_node_id,
3521
3521
3522
3522
counterparty_shutdown_scriptpubkey: None,
@@ -5596,7 +5596,7 @@ where
5596
5596
// Use the previous commitment number and point when splicing since they shouldn't change.
5597
5597
if commitment_number != INITIAL_COMMITMENT_NUMBER {
5598
5598
commitment_number += 1;
5599
- commitment_point = self.counterparty_prev_commitment_point .unwrap();
5599
+ commitment_point = self.counterparty_current_commitment_point .unwrap();
5600
5600
}
5601
5601
5602
5602
let commitment_data = self.build_commitment_transaction(
@@ -6758,9 +6758,9 @@ where
6758
6758
self.context.counterparty_next_commitment_point
6759
6759
} else if self.context.counterparty_next_commitment_transaction_number == INITIAL_COMMITMENT_NUMBER - 2 {
6760
6760
// If we've advanced the commitment number once, the second commitment point is
6761
- // at `counterparty_prev_commitment_point `, which is not yet revoked.
6762
- debug_assert!(self.context.counterparty_prev_commitment_point .is_some());
6763
- self.context.counterparty_prev_commitment_point
6761
+ // at `counterparty_current_commitment_point `, which is not yet revoked.
6762
+ debug_assert!(self.context.counterparty_current_commitment_point .is_some());
6763
+ self.context.counterparty_current_commitment_point
6764
6764
} else {
6765
6765
// If they have sent updated points, channel_ready is always supposed to match
6766
6766
// their "first" point, which we re-derive here.
@@ -6774,7 +6774,7 @@ where
6774
6774
return Ok(None);
6775
6775
}
6776
6776
6777
- self.context.counterparty_prev_commitment_point = self.context.counterparty_next_commitment_point;
6777
+ self.context.counterparty_current_commitment_point = self.context.counterparty_next_commitment_point;
6778
6778
self.context.counterparty_next_commitment_point = Some(msg.next_per_commitment_point);
6779
6779
// Clear any interactive signing session.
6780
6780
self.interactive_tx_signing_session = None;
@@ -7004,7 +7004,7 @@ where
7004
7004
.build_commitment_transaction(
7005
7005
pending_splice_funding,
7006
7006
self.context.counterparty_next_commitment_transaction_number + 1,
7007
- &self.context.counterparty_prev_commitment_point .unwrap(),
7007
+ &self.context.counterparty_current_commitment_point .unwrap(),
7008
7008
false,
7009
7009
false,
7010
7010
logger,
@@ -7591,11 +7591,11 @@ where
7591
7591
"Peer provided an invalid per_commitment_secret".to_owned()
7592
7592
);
7593
7593
7594
- if let Some(counterparty_prev_commitment_point ) =
7595
- self.context.counterparty_prev_commitment_point
7594
+ if let Some(counterparty_current_commitment_point ) =
7595
+ self.context.counterparty_current_commitment_point
7596
7596
{
7597
7597
if PublicKey::from_secret_key(&self.context.secp_ctx, &secret)
7598
- != counterparty_prev_commitment_point
7598
+ != counterparty_current_commitment_point
7599
7599
{
7600
7600
return Err(ChannelError::close("Got a revoke commitment secret which didn't correspond to their current pubkey".to_owned()));
7601
7601
}
@@ -7663,7 +7663,7 @@ where
7663
7663
// channel based on that, but stepping stuff here should be safe either way.
7664
7664
self.context.channel_state.clear_awaiting_remote_revoke();
7665
7665
self.mark_response_received();
7666
- self.context.counterparty_prev_commitment_point =
7666
+ self.context.counterparty_current_commitment_point =
7667
7667
self.context.counterparty_next_commitment_point;
7668
7668
self.context.counterparty_next_commitment_point = Some(msg.next_per_commitment_point);
7669
7669
self.context.counterparty_next_commitment_transaction_number -= 1;
@@ -13133,7 +13133,7 @@ where
13133
13133
self.funding.funding_transaction.write(writer)?;
13134
13134
13135
13135
self.context.counterparty_next_commitment_point.write(writer)?;
13136
- self.context.counterparty_prev_commitment_point .write(writer)?;
13136
+ self.context.counterparty_current_commitment_point .write(writer)?;
13137
13137
self.context.counterparty_node_id.write(writer)?;
13138
13138
13139
13139
self.context.counterparty_shutdown_scriptpubkey.write(writer)?;
@@ -13534,7 +13534,7 @@ where
13534
13534
13535
13535
let counterparty_next_commitment_point = Readable::read(reader)?;
13536
13536
13537
- let counterparty_prev_commitment_point = Readable::read(reader)?;
13537
+ let counterparty_current_commitment_point = Readable::read(reader)?;
13538
13538
let counterparty_node_id = Readable::read(reader)?;
13539
13539
13540
13540
let counterparty_shutdown_scriptpubkey = Readable::read(reader)?;
@@ -13987,7 +13987,7 @@ where
13987
13987
is_batch_funding,
13988
13988
13989
13989
counterparty_next_commitment_point,
13990
- counterparty_prev_commitment_point ,
13990
+ counterparty_current_commitment_point ,
13991
13991
counterparty_node_id,
13992
13992
13993
13993
counterparty_shutdown_scriptpubkey,
0 commit comments