@@ -560,7 +560,7 @@ impl ChannelState {
560
560
}
561
561
}
562
562
563
- fn should_force_holding_cell (&self) -> bool {
563
+ fn can_generate_new_commitment (&self) -> bool {
564
564
match self {
565
565
ChannelState::ChannelReady(flags) =>
566
566
flags.is_set(ChannelReadyFlags::AWAITING_REMOTE_REVOKE) ||
@@ -2709,7 +2709,7 @@ impl<SP: Deref> Channel<SP> where
2709
2709
where L::Target: Logger {
2710
2710
// Assert that we'll add the HTLC claim to the holding cell in `get_update_fulfill_htlc`
2711
2711
// (see equivalent if condition there).
2712
- assert!(self.context.channel_state.should_force_holding_cell ());
2712
+ assert!(self.context.channel_state.can_generate_new_commitment ());
2713
2713
let mon_update_id = self.context.latest_monitor_update_id; // Forget the ChannelMonitor update
2714
2714
let fulfill_resp = self.get_update_fulfill_htlc(htlc_id_arg, payment_preimage_arg, logger);
2715
2715
self.context.latest_monitor_update_id = mon_update_id;
@@ -2778,7 +2778,7 @@ impl<SP: Deref> Channel<SP> where
2778
2778
}],
2779
2779
};
2780
2780
2781
- if self.context.channel_state.should_force_holding_cell () {
2781
+ if self.context.channel_state.can_generate_new_commitment () {
2782
2782
// Note that this condition is the same as the assertion in
2783
2783
// `claim_htlc_while_disconnected_dropping_mon_update` and must match exactly -
2784
2784
// `claim_htlc_while_disconnected_dropping_mon_update` would not work correctly if we
@@ -2937,7 +2937,7 @@ impl<SP: Deref> Channel<SP> where
2937
2937
return Ok(None);
2938
2938
}
2939
2939
2940
- if self.context.channel_state.should_force_holding_cell () {
2940
+ if self.context.channel_state.can_generate_new_commitment () {
2941
2941
debug_assert!(force_holding_cell, "!force_holding_cell is only called when emptying the holding cell, so we shouldn't end up back in it!");
2942
2942
force_holding_cell = true;
2943
2943
}
@@ -3636,7 +3636,7 @@ impl<SP: Deref> Channel<SP> where
3636
3636
) -> (Option<ChannelMonitorUpdate>, Vec<(HTLCSource, PaymentHash)>)
3637
3637
where F::Target: FeeEstimator, L::Target: Logger
3638
3638
{
3639
- if matches!(self.context.channel_state, ChannelState::ChannelReady(_)) && !self.context.channel_state.should_force_holding_cell () {
3639
+ if matches!(self.context.channel_state, ChannelState::ChannelReady(_)) && !self.context.channel_state.can_generate_new_commitment () {
3640
3640
self.free_holding_cell_htlcs(fee_estimator, logger)
3641
3641
} else { (None, Vec::new()) }
3642
3642
}
@@ -5904,7 +5904,7 @@ impl<SP: Deref> Channel<SP> where
5904
5904
return Err(ChannelError::Ignore("Cannot send an HTLC while disconnected from channel counterparty".to_owned()));
5905
5905
}
5906
5906
5907
- let need_holding_cell = self.context.channel_state.should_force_holding_cell ();
5907
+ let need_holding_cell = self.context.channel_state.can_generate_new_commitment ();
5908
5908
log_debug!(logger, "Pushing new outbound HTLC with hash {} for {} msat {}",
5909
5909
payment_hash, amount_msat,
5910
5910
if force_holding_cell { "into holding cell" }
0 commit comments