@@ -2669,7 +2669,7 @@ where
2669
2669
is_manual_broadcast: bool,
2670
2670
is_batch_funding: Option<()>,
2671
2671
2672
- counterparty_cur_commitment_point : Option<PublicKey>,
2672
+ counterparty_next_commitment_point : Option<PublicKey>,
2673
2673
counterparty_prev_commitment_point: Option<PublicKey>,
2674
2674
counterparty_node_id: PublicKey,
2675
2675
@@ -2821,7 +2821,7 @@ where
2821
2821
let context = self.context();
2822
2822
let commitment_data = context.build_commitment_transaction(self.funding(),
2823
2823
context.counterparty_next_commitment_transaction_number,
2824
- &context.counterparty_cur_commitment_point .unwrap(), false, false, logger);
2824
+ &context.counterparty_next_commitment_point .unwrap(), false, false, logger);
2825
2825
let counterparty_initial_commitment_tx = commitment_data.tx;
2826
2826
let counterparty_trusted_tx = counterparty_initial_commitment_tx.trust();
2827
2827
let counterparty_initial_bitcoin_tx = counterparty_trusted_tx.built_transaction();
@@ -3297,7 +3297,7 @@ where
3297
3297
3298
3298
is_batch_funding: None,
3299
3299
3300
- counterparty_cur_commitment_point : Some(open_channel_fields.first_per_commitment_point),
3300
+ counterparty_next_commitment_point : Some(open_channel_fields.first_per_commitment_point),
3301
3301
counterparty_prev_commitment_point: None,
3302
3302
counterparty_node_id,
3303
3303
@@ -3535,7 +3535,7 @@ where
3535
3535
3536
3536
is_batch_funding: None,
3537
3537
3538
- counterparty_cur_commitment_point : None,
3538
+ counterparty_next_commitment_point : None,
3539
3539
counterparty_prev_commitment_point: None,
3540
3540
counterparty_node_id,
3541
3541
@@ -3915,7 +3915,7 @@ where
3915
3915
pubkeys: counterparty_pubkeys,
3916
3916
});
3917
3917
3918
- self.counterparty_cur_commitment_point = Some(common_fields.first_per_commitment_point);
3918
+ self.counterparty_next_commitment_point = Some(common_fields.first_per_commitment_point);
3919
3919
self.counterparty_shutdown_scriptpubkey = counterparty_shutdown_scriptpubkey;
3920
3920
3921
3921
self.channel_state = ChannelState::NegotiatingFunding(
@@ -5609,7 +5609,7 @@ where
5609
5609
L::Target: Logger,
5610
5610
{
5611
5611
let mut commitment_number = self.counterparty_next_commitment_transaction_number;
5612
- let mut commitment_point = self.counterparty_cur_commitment_point .unwrap();
5612
+ let mut commitment_point = self.counterparty_next_commitment_point .unwrap();
5613
5613
5614
5614
// Use the previous commitment number and point when splicing since they shouldn't change.
5615
5615
if commitment_number != INITIAL_COMMITMENT_NUMBER {
@@ -5682,13 +5682,13 @@ where
5682
5682
#[cfg(all(test))]
5683
5683
pub fn get_initial_counterparty_commitment_signature_for_test<L: Deref>(
5684
5684
&mut self, funding: &mut FundingScope, logger: &L,
5685
- counterparty_cur_commitment_point_override : PublicKey,
5685
+ counterparty_next_commitment_point_override : PublicKey,
5686
5686
) -> Option<Signature>
5687
5687
where
5688
5688
SP::Target: SignerProvider,
5689
5689
L::Target: Logger,
5690
5690
{
5691
- self.counterparty_cur_commitment_point = Some(counterparty_cur_commitment_point_override );
5691
+ self.counterparty_next_commitment_point = Some(counterparty_next_commitment_point_override );
5692
5692
self.get_initial_counterparty_commitment_signature(funding, logger)
5693
5693
}
5694
5694
@@ -6778,8 +6778,8 @@ where
6778
6778
let expected_point =
6779
6779
if self.context.counterparty_next_commitment_transaction_number == INITIAL_COMMITMENT_NUMBER - 1 {
6780
6780
// If they haven't ever sent an updated point, the point they send should match
6781
- // the current one.
6782
- self.context.counterparty_cur_commitment_point
6781
+ // the next one.
6782
+ self.context.counterparty_next_commitment_point
6783
6783
} else if self.context.counterparty_next_commitment_transaction_number == INITIAL_COMMITMENT_NUMBER - 2 {
6784
6784
// If we've advanced the commitment number once, the second commitment point is
6785
6785
// at `counterparty_prev_commitment_point`, which is not yet revoked.
@@ -6798,8 +6798,8 @@ where
6798
6798
return Ok(None);
6799
6799
}
6800
6800
6801
- self.context.counterparty_prev_commitment_point = self.context.counterparty_cur_commitment_point ;
6802
- self.context.counterparty_cur_commitment_point = Some(msg.next_per_commitment_point);
6801
+ self.context.counterparty_prev_commitment_point = self.context.counterparty_next_commitment_point ;
6802
+ self.context.counterparty_next_commitment_point = Some(msg.next_per_commitment_point);
6803
6803
// Clear any interactive signing session.
6804
6804
self.interactive_tx_signing_session = None;
6805
6805
@@ -7688,8 +7688,8 @@ where
7688
7688
self.context.channel_state.clear_awaiting_remote_revoke();
7689
7689
self.mark_response_received();
7690
7690
self.context.counterparty_prev_commitment_point =
7691
- self.context.counterparty_cur_commitment_point ;
7692
- self.context.counterparty_cur_commitment_point = Some(msg.next_per_commitment_point);
7691
+ self.context.counterparty_next_commitment_point ;
7692
+ self.context.counterparty_next_commitment_point = Some(msg.next_per_commitment_point);
7693
7693
self.context.counterparty_next_commitment_transaction_number -= 1;
7694
7694
7695
7695
if self.context.announcement_sigs_state == AnnouncementSigsState::Committed {
@@ -8430,7 +8430,7 @@ where
8430
8430
let funding_signed = if self.context.signer_pending_funding && !self.funding.is_outbound() {
8431
8431
let commitment_data = self.context.build_commitment_transaction(&self.funding,
8432
8432
self.context.counterparty_next_commitment_transaction_number + 1,
8433
- &self.context.counterparty_cur_commitment_point .unwrap(), false, false, logger);
8433
+ &self.context.counterparty_next_commitment_point .unwrap(), false, false, logger);
8434
8434
let counterparty_initial_commitment_tx = commitment_data.tx;
8435
8435
self.context.get_funding_signed_msg(&self.funding.channel_transaction_parameters, logger, counterparty_initial_commitment_tx)
8436
8436
} else { None };
@@ -11203,7 +11203,7 @@ where
11203
11203
commitment_txid: counterparty_commitment_tx.trust().txid(),
11204
11204
htlc_outputs,
11205
11205
commitment_number: self.context.counterparty_next_commitment_transaction_number,
11206
- their_per_commitment_point: self.context.counterparty_cur_commitment_point .unwrap(),
11206
+ their_per_commitment_point: self.context.counterparty_next_commitment_point .unwrap(),
11207
11207
feerate_per_kw: Some(counterparty_commitment_tx.feerate_per_kw()),
11208
11208
to_broadcaster_value_sat: Some(counterparty_commitment_tx.to_broadcaster_value_sat()),
11209
11209
to_countersignatory_value_sat: Some(counterparty_commitment_tx.to_countersignatory_value_sat()),
@@ -11260,7 +11260,7 @@ where
11260
11260
{
11261
11261
let commitment_data = self.context.build_commitment_transaction(
11262
11262
funding, self.context.counterparty_next_commitment_transaction_number,
11263
- &self.context.counterparty_cur_commitment_point .unwrap(), false, true, logger,
11263
+ &self.context.counterparty_next_commitment_point .unwrap(), false, true, logger,
11264
11264
);
11265
11265
let counterparty_commitment_tx = commitment_data.tx;
11266
11266
@@ -11311,7 +11311,7 @@ where
11311
11311
11312
11312
let commitment_data = self.context.build_commitment_transaction(
11313
11313
funding, self.context.counterparty_next_commitment_transaction_number,
11314
- &self.context.counterparty_cur_commitment_point .unwrap(), false, true, logger,
11314
+ &self.context.counterparty_next_commitment_point .unwrap(), false, true, logger,
11315
11315
);
11316
11316
let counterparty_commitment_tx = commitment_data.tx;
11317
11317
@@ -11880,7 +11880,7 @@ where
11880
11880
fn get_funding_created_msg<L: Deref>(&mut self, logger: &L) -> Option<msgs::FundingCreated> where L::Target: Logger {
11881
11881
let commitment_data = self.context.build_commitment_transaction(&self.funding,
11882
11882
self.context.counterparty_next_commitment_transaction_number,
11883
- &self.context.counterparty_cur_commitment_point .unwrap(), false, false, logger);
11883
+ &self.context.counterparty_next_commitment_point .unwrap(), false, false, logger);
11884
11884
let counterparty_initial_commitment_tx = commitment_data.tx;
11885
11885
let signature = match &self.context.holder_signer {
11886
11886
// TODO (taproot|arik): move match into calling method for Taproot
@@ -13167,7 +13167,7 @@ where
13167
13167
self.funding.channel_transaction_parameters.write(writer)?;
13168
13168
self.funding.funding_transaction.write(writer)?;
13169
13169
13170
- self.context.counterparty_cur_commitment_point .write(writer)?;
13170
+ self.context.counterparty_next_commitment_point .write(writer)?;
13171
13171
self.context.counterparty_prev_commitment_point.write(writer)?;
13172
13172
self.context.counterparty_node_id.write(writer)?;
13173
13173
@@ -13568,7 +13568,7 @@ where
13568
13568
ReadableArgs::<Option<u64>>::read(reader, Some(channel_value_satoshis))?;
13569
13569
let funding_transaction: Option<Transaction> = Readable::read(reader)?;
13570
13570
13571
- let counterparty_cur_commitment_point = Readable::read(reader)?;
13571
+ let counterparty_next_commitment_point = Readable::read(reader)?;
13572
13572
13573
13573
let counterparty_prev_commitment_point = Readable::read(reader)?;
13574
13574
let counterparty_node_id = Readable::read(reader)?;
@@ -14025,7 +14025,7 @@ where
14025
14025
14026
14026
is_batch_funding,
14027
14027
14028
- counterparty_cur_commitment_point ,
14028
+ counterparty_next_commitment_point ,
14029
14029
counterparty_prev_commitment_point,
14030
14030
counterparty_node_id,
14031
14031
0 commit comments