@@ -1252,7 +1252,7 @@ pub(crate) struct ShutdownResult {
1252
1252
struct HolderCommitmentPoint {
1253
1253
transaction_number: u64,
1254
1254
point: PublicKey,
1255
- next_point : Option<PublicKey>,
1255
+ pending_next_point : Option<PublicKey>,
1256
1256
}
1257
1257
1258
1258
impl HolderCommitmentPoint {
@@ -1263,12 +1263,12 @@ impl HolderCommitmentPoint {
1263
1263
Some(HolderCommitmentPoint {
1264
1264
transaction_number: INITIAL_COMMITMENT_NUMBER,
1265
1265
point: signer.as_ref().get_per_commitment_point(INITIAL_COMMITMENT_NUMBER, secp_ctx).ok()?,
1266
- next_point : signer.as_ref().get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, secp_ctx).ok(),
1266
+ pending_next_point : signer.as_ref().get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, secp_ctx).ok(),
1267
1267
})
1268
1268
}
1269
1269
1270
1270
pub fn can_advance(&self) -> bool {
1271
- self.next_point .is_some()
1271
+ self.pending_next_point .is_some()
1272
1272
}
1273
1273
1274
1274
pub fn transaction_number(&self) -> u64 {
@@ -1279,32 +1279,29 @@ impl HolderCommitmentPoint {
1279
1279
self.point
1280
1280
}
1281
1281
1282
- pub fn next_point(&self) -> Option<PublicKey> {
1283
- self.next_point
1284
- }
1285
-
1286
- /// If we are pending the next commitment point, this method tries asking the signer again.
1282
+ /// If we are pending advancing the next commitment point, this method tries asking the signer
1283
+ /// again.
1287
1284
pub fn try_resolve_pending<SP: Deref, L: Deref>(
1288
1285
&mut self, signer: &ChannelSignerType<SP>, secp_ctx: &Secp256k1<secp256k1::All>, logger: &L,
1289
1286
) where
1290
1287
SP::Target: SignerProvider,
1291
1288
L::Target: Logger,
1292
1289
{
1293
1290
if !self.can_advance() {
1294
- let next =
1291
+ let pending_next_point =
1295
1292
signer.as_ref().get_per_commitment_point(self.transaction_number - 1, secp_ctx);
1296
- if let Ok(next ) = next {
1293
+ if let Ok(point ) = pending_next_point {
1297
1294
log_trace!(
1298
1295
logger,
1299
- "Retrieved next per-commitment point {}",
1296
+ "Retrieved per-commitment point {} for next advancement ",
1300
1297
self.transaction_number - 1
1301
1298
);
1302
- self.next_point = Some(next );
1299
+ self.pending_next_point = Some(point );
1303
1300
} else {
1304
1301
log_trace!(
1305
1302
logger,
1306
- "Next per-commitment point {} is pending ",
1307
- self.transaction_number
1303
+ "Pending per-commitment point {} for next advancement ",
1304
+ self.transaction_number - 1
1308
1305
);
1309
1306
}
1310
1307
}
@@ -1327,11 +1324,11 @@ impl HolderCommitmentPoint {
1327
1324
SP::Target: SignerProvider,
1328
1325
L::Target: Logger,
1329
1326
{
1330
- if let Some(next_point) = self.next_point {
1327
+ if let Some(next_point) = self.pending_next_point {
1331
1328
*self = Self {
1332
1329
transaction_number: self.transaction_number - 1,
1333
1330
point: next_point,
1334
- next_point : None,
1331
+ pending_next_point : None,
1335
1332
};
1336
1333
1337
1334
self.try_resolve_pending(signer, secp_ctx, logger);
@@ -13202,7 +13199,7 @@ where
13202
13199
13203
13200
// `HolderCommitmentPoint::point` will become optional when async signing is implemented.
13204
13201
let holder_commitment_point = Some(self.holder_commitment_point.point());
13205
- let holder_commitment_point_next_advance = self.holder_commitment_point.next_point() ;
13202
+ let holder_commitment_point_pending_next = self.holder_commitment_point.pending_next_point ;
13206
13203
13207
13204
write_tlv_fields!(writer, {
13208
13205
(0, self.context.announcement_sigs, option),
@@ -13241,7 +13238,7 @@ where
13241
13238
(41, holding_cell_blinding_points, optional_vec),
13242
13239
(43, malformed_htlcs, optional_vec), // Added in 0.0.119
13243
13240
(45, holder_commitment_point, option),
13244
- (47, holder_commitment_point_next_advance , option),
13241
+ (47, holder_commitment_point_pending_next , option),
13245
13242
(49, self.context.local_initiated_shutdown, option), // Added in 0.0.122
13246
13243
(51, is_manual_broadcast, option), // Added in 0.0.124
13247
13244
(53, funding_tx_broadcast_safe_event_emitted, option), // Added in 0.0.124
@@ -13602,7 +13599,7 @@ where
13602
13599
let mut monitor_pending_update_adds: Option<Vec<msgs::UpdateAddHTLC>> = None;
13603
13600
13604
13601
let mut holder_commitment_point_opt: Option<PublicKey> = None;
13605
- let mut holder_commitment_point_next_advance_opt : Option<PublicKey> = None;
13602
+ let mut holder_commitment_point_pending_next_opt : Option<PublicKey> = None;
13606
13603
let mut is_manual_broadcast = None;
13607
13604
13608
13605
let mut pending_funding = Some(Vec::new());
@@ -13643,7 +13640,7 @@ where
13643
13640
(41, holding_cell_blinding_points_opt, optional_vec),
13644
13641
(43, malformed_htlcs, optional_vec), // Added in 0.0.119
13645
13642
(45, holder_commitment_point_opt, option),
13646
- (47, holder_commitment_point_next_advance_opt , option),
13643
+ (47, holder_commitment_point_pending_next_opt , option),
13647
13644
(49, local_initiated_shutdown, option),
13648
13645
(51, is_manual_broadcast, option),
13649
13646
(53, funding_tx_broadcast_safe_event_emitted, option),
@@ -13832,27 +13829,27 @@ where
13832
13829
// signer be available so that we can immediately populate the current commitment point. Channel
13833
13830
// restoration will fail if this is not possible.
13834
13831
let holder_commitment_point =
13835
- match (holder_commitment_point_opt, holder_commitment_point_next_advance_opt ) {
13836
- (Some(point), next_point ) => HolderCommitmentPoint {
13832
+ match (holder_commitment_point_opt, holder_commitment_point_pending_next_opt ) {
13833
+ (Some(point), pending_next_point ) => HolderCommitmentPoint {
13837
13834
transaction_number: holder_commitment_transaction_number,
13838
13835
point,
13839
- next_point ,
13836
+ pending_next_point ,
13840
13837
},
13841
13838
(_, _) => {
13842
13839
let point = holder_signer.get_per_commitment_point(holder_commitment_transaction_number, &secp_ctx)
13843
13840
.expect("Must be able to derive the current commitment point upon channel restoration");
13844
- let next_point = holder_signer
13841
+ let pending_next_point = holder_signer
13845
13842
.get_per_commitment_point(
13846
13843
holder_commitment_transaction_number - 1,
13847
13844
&secp_ctx,
13848
13845
)
13849
13846
.expect(
13850
- "Must be able to derive the next commitment point upon channel restoration",
13847
+ "Must be able to derive the pending next commitment point upon channel restoration",
13851
13848
);
13852
13849
HolderCommitmentPoint {
13853
13850
transaction_number: holder_commitment_transaction_number,
13854
13851
point,
13855
- next_point : Some(next_point ),
13852
+ pending_next_point : Some(pending_next_point ),
13856
13853
}
13857
13854
},
13858
13855
};
0 commit comments