@@ -1091,8 +1091,8 @@ pub(crate) const CONCURRENT_INBOUND_HTLC_FEE_BUFFER: u32 = 2;
1091
1091
/// transaction (not counting the value of the HTLCs themselves).
1092
1092
pub(crate) const MIN_AFFORDABLE_HTLC_COUNT: usize = 4;
1093
1093
1094
- /// When a [`Channel `] has its [`ChannelConfig`] updated, its existing one is stashed for up to this
1095
- /// number of ticks to allow forwarding HTLCs by nodes that have yet to receive the new
1094
+ /// When a [`FundedChannel `] has its [`ChannelConfig`] updated, its existing one is stashed for up
1095
+ /// to this number of ticks to allow forwarding HTLCs by nodes that have yet to receive the new
1096
1096
/// ChannelUpdate prompted by the config update. This value was determined as follows:
1097
1097
///
1098
1098
/// * The expected interval between ticks (1 minute).
@@ -1109,7 +1109,7 @@ pub(crate) const EXPIRE_PREV_CONFIG_TICKS: usize = 5;
1109
1109
pub(crate) const DISCONNECT_PEER_AWAITING_RESPONSE_TICKS: usize = 2;
1110
1110
1111
1111
/// The number of ticks that may elapse while we're waiting for an unfunded outbound/inbound channel
1112
- /// to be promoted to a [`Channel `] since the unfunded channel was created. An unfunded channel
1112
+ /// to be promoted to a [`FundedChannel `] since the unfunded channel was created. An unfunded channel
1113
1113
/// exceeding this age limit will be force-closed and purged from memory.
1114
1114
pub(crate) const UNFUNDED_CHANNEL_AGE_LIMIT_TICKS: usize = 60;
1115
1115
@@ -1131,7 +1131,7 @@ pub(super) enum ChannelPhase<SP: Deref> where SP::Target: SignerProvider {
1131
1131
UnfundedInboundV1(InboundV1Channel<SP>),
1132
1132
#[allow(dead_code)] // TODO(dual_funding): Remove once creating V2 channels is enabled.
1133
1133
UnfundedV2(PendingV2Channel<SP>),
1134
- Funded(Channel <SP>),
1134
+ Funded(FundedChannel <SP>),
1135
1135
}
1136
1136
1137
1137
impl<'a, SP: Deref> ChannelPhase<SP> where
@@ -1169,15 +1169,15 @@ impl<'a, SP: Deref> ChannelPhase<SP> where
1169
1169
self.as_funded().is_some()
1170
1170
}
1171
1171
1172
- pub fn as_funded(&self) -> Option<&Channel <SP>> {
1172
+ pub fn as_funded(&self) -> Option<&FundedChannel <SP>> {
1173
1173
if let ChannelPhase::Funded(channel) = self {
1174
1174
Some(channel)
1175
1175
} else {
1176
1176
None
1177
1177
}
1178
1178
}
1179
1179
1180
- pub fn as_funded_mut(&mut self) -> Option<&mut Channel <SP>> {
1180
+ pub fn as_funded_mut(&mut self) -> Option<&mut FundedChannel <SP>> {
1181
1181
if let ChannelPhase::Funded(channel) = self {
1182
1182
Some(channel)
1183
1183
} else {
@@ -1388,12 +1388,12 @@ where
1388
1388
}
1389
1389
}
1390
1390
1391
- impl<SP: Deref> From<Channel <SP>> for ChannelPhase<SP>
1391
+ impl<SP: Deref> From<FundedChannel <SP>> for ChannelPhase<SP>
1392
1392
where
1393
1393
SP::Target: SignerProvider,
1394
1394
<SP::Target as SignerProvider>::EcdsaSigner: ChannelSigner,
1395
1395
{
1396
- fn from(channel: Channel <SP>) -> Self {
1396
+ fn from(channel: FundedChannel <SP>) -> Self {
1397
1397
ChannelPhase::Funded(channel)
1398
1398
}
1399
1399
}
@@ -1514,7 +1514,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
1514
1514
/// the future when the signer indicates it may have a signature for us.
1515
1515
///
1516
1516
/// This flag is set in such a case. Note that we don't need to persist this as we'll end up
1517
- /// setting it again as a side-effect of [`Channel ::channel_reestablish`].
1517
+ /// setting it again as a side-effect of [`FundedChannel ::channel_reestablish`].
1518
1518
signer_pending_commitment_update: bool,
1519
1519
/// Similar to [`Self::signer_pending_commitment_update`] but we're waiting to send either a
1520
1520
/// [`msgs::FundingCreated`] or [`msgs::FundingSigned`] depending on if this channel is
@@ -1910,7 +1910,7 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> whe
1910
1910
}
1911
1911
}
1912
1912
1913
- impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for Channel <SP> where SP::Target: SignerProvider {
1913
+ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel <SP> where SP::Target: SignerProvider {
1914
1914
fn context(&self) -> &ChannelContext<SP> {
1915
1915
&self.context
1916
1916
}
@@ -2140,7 +2140,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
2140
2140
if open_channel_fields.htlc_minimum_msat >= full_channel_value_msat {
2141
2141
return Err(ChannelError::close(format!("Minimum htlc value ({}) was larger than full channel value ({})", open_channel_fields.htlc_minimum_msat, full_channel_value_msat)));
2142
2142
}
2143
- Channel ::<SP>::check_remote_fee(&channel_type, fee_estimator, open_channel_fields.commitment_feerate_sat_per_1000_weight, None, &&logger)?;
2143
+ FundedChannel ::<SP>::check_remote_fee(&channel_type, fee_estimator, open_channel_fields.commitment_feerate_sat_per_1000_weight, None, &&logger)?;
2144
2144
2145
2145
let max_counterparty_selected_contest_delay = u16::min(config.channel_handshake_limits.their_to_self_delay, MAX_LOCAL_BREAKDOWN_TIMEOUT);
2146
2146
if open_channel_fields.to_self_delay > max_counterparty_selected_contest_delay {
@@ -4410,7 +4410,7 @@ pub(super) struct DualFundingChannelContext {
4410
4410
4411
4411
// Holder designates channel data owned for the benefit of the user client.
4412
4412
// Counterparty designates channel data owned by the another channel participant entity.
4413
- pub(super) struct Channel <SP: Deref> where SP::Target: SignerProvider {
4413
+ pub(super) struct FundedChannel <SP: Deref> where SP::Target: SignerProvider {
4414
4414
pub context: ChannelContext<SP>,
4415
4415
pub interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
4416
4416
holder_commitment_point: HolderCommitmentPoint,
@@ -4425,7 +4425,7 @@ struct CommitmentTxInfoCached {
4425
4425
feerate: u32,
4426
4426
}
4427
4427
4428
- /// Contents of a wire message that fails an HTLC backwards. Useful for [`Channel ::fail_htlc`] to
4428
+ /// Contents of a wire message that fails an HTLC backwards. Useful for [`FundedChannel ::fail_htlc`] to
4429
4429
/// fail with either [`msgs::UpdateFailMalformedHTLC`] or [`msgs::UpdateFailHTLC`] as needed.
4430
4430
trait FailHTLCContents {
4431
4431
type Message: FailHTLCMessageName;
@@ -4481,7 +4481,7 @@ impl FailHTLCMessageName for msgs::UpdateFailMalformedHTLC {
4481
4481
}
4482
4482
}
4483
4483
4484
- impl<SP: Deref> Channel <SP> where
4484
+ impl<SP: Deref> FundedChannel <SP> where
4485
4485
SP::Target: SignerProvider,
4486
4486
<SP::Target as SignerProvider>::EcdsaSigner: EcdsaChannelSigner
4487
4487
{
@@ -5989,7 +5989,7 @@ impl<SP: Deref> Channel<SP> where
5989
5989
/// new feerate, the update is cancelled.
5990
5990
///
5991
5991
/// You MUST call [`Self::send_commitment_no_state_update`] prior to any other calls on this
5992
- /// [`Channel `] if `force_holding_cell` is false.
5992
+ /// [`FundedChannel `] if `force_holding_cell` is false.
5993
5993
fn send_update_fee<F: Deref, L: Deref>(
5994
5994
&mut self, feerate_per_kw: u32, mut force_holding_cell: bool,
5995
5995
fee_estimator: &LowerBoundedFeeEstimator<F>, logger: &L
@@ -6283,7 +6283,7 @@ impl<SP: Deref> Channel<SP> where
6283
6283
if self.context.channel_state.is_peer_disconnected() {
6284
6284
return Err(ChannelError::close("Peer sent update_fee when we needed a channel_reestablish".to_owned()));
6285
6285
}
6286
- Channel ::<SP>::check_remote_fee(&self.context.channel_type, fee_estimator, msg.feerate_per_kw, Some(self.context.feerate_per_kw), logger)?;
6286
+ FundedChannel ::<SP>::check_remote_fee(&self.context.channel_type, fee_estimator, msg.feerate_per_kw, Some(self.context.feerate_per_kw), logger)?;
6287
6287
6288
6288
self.context.pending_update_fee = Some((msg.feerate_per_kw, FeeUpdateState::RemoteAnnounced));
6289
6289
self.context.update_time_counter += 1;
@@ -8070,7 +8070,7 @@ impl<SP: Deref> Channel<SP> where
8070
8070
/// regenerate them.
8071
8071
///
8072
8072
/// You MUST call [`Self::send_commitment_no_state_update`] prior to calling any other methods
8073
- /// on this [`Channel `] if `force_holding_cell` is false.
8073
+ /// on this [`FundedChannel `] if `force_holding_cell` is false.
8074
8074
///
8075
8075
/// `Err`s will only be [`ChannelError::Ignore`].
8076
8076
fn send_htlc<F: Deref, L: Deref>(
@@ -8694,7 +8694,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
8694
8694
/// If this call is successful, broadcast the funding transaction (and not before!)
8695
8695
pub fn funding_signed<L: Deref>(
8696
8696
mut self, msg: &msgs::FundingSigned, best_block: BestBlock, signer_provider: &SP, logger: &L
8697
- ) -> Result<(Channel <SP>, ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>), (OutboundV1Channel<SP>, ChannelError)>
8697
+ ) -> Result<(FundedChannel <SP>, ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>), (OutboundV1Channel<SP>, ChannelError)>
8698
8698
where
8699
8699
L::Target: Logger
8700
8700
{
@@ -8721,7 +8721,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
8721
8721
8722
8722
log_info!(logger, "Received funding_signed from peer for channel {}", &self.context.channel_id());
8723
8723
8724
- let mut channel = Channel {
8724
+ let mut channel = FundedChannel {
8725
8725
context: self.context,
8726
8726
interactive_tx_signing_session: None,
8727
8727
holder_commitment_point,
@@ -8942,7 +8942,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
8942
8942
8943
8943
pub fn funding_created<L: Deref>(
8944
8944
mut self, msg: &msgs::FundingCreated, best_block: BestBlock, signer_provider: &SP, logger: &L
8945
- ) -> Result<(Channel <SP>, Option<msgs::FundingSigned>, ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>), (Self, ChannelError)>
8945
+ ) -> Result<(FundedChannel <SP>, Option<msgs::FundingSigned>, ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>), (Self, ChannelError)>
8946
8946
where
8947
8947
L::Target: Logger
8948
8948
{
@@ -8986,7 +8986,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
8986
8986
8987
8987
// Promote the channel to a full-fledged one now that we have updated the state and have a
8988
8988
// `ChannelMonitor`.
8989
- let mut channel = Channel {
8989
+ let mut channel = FundedChannel {
8990
8990
context: self.context,
8991
8991
interactive_tx_signing_session: None,
8992
8992
holder_commitment_point,
@@ -9343,11 +9343,11 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
9343
9343
self.generate_accept_channel_v2_message()
9344
9344
}
9345
9345
9346
- pub fn into_channel(self, signing_session: InteractiveTxSigningSession) -> Result<Channel <SP>, ChannelError>{
9346
+ pub fn into_channel(self, signing_session: InteractiveTxSigningSession) -> Result<FundedChannel <SP>, ChannelError>{
9347
9347
let holder_commitment_point = self.unfunded_context.holder_commitment_point.ok_or(ChannelError::close(
9348
9348
format!("Expected to have holder commitment points available upon finishing interactive tx construction for channel {}",
9349
9349
self.context.channel_id())))?;
9350
- let channel = Channel {
9350
+ let channel = FundedChannel {
9351
9351
context: self.context,
9352
9352
interactive_tx_signing_session: Some(signing_session),
9353
9353
holder_commitment_point,
@@ -9439,7 +9439,7 @@ impl Readable for AnnouncementSigsState {
9439
9439
}
9440
9440
}
9441
9441
9442
- impl<SP: Deref> Writeable for Channel <SP> where SP::Target: SignerProvider {
9442
+ impl<SP: Deref> Writeable for FundedChannel <SP> where SP::Target: SignerProvider {
9443
9443
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
9444
9444
// Note that we write out as if remove_uncommitted_htlcs_and_mark_paused had just been
9445
9445
// called.
@@ -9818,7 +9818,7 @@ impl<SP: Deref> Writeable for Channel<SP> where SP::Target: SignerProvider {
9818
9818
}
9819
9819
9820
9820
const MAX_ALLOC_SIZE: usize = 64*1024;
9821
- impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c ChannelTypeFeatures)> for Channel <SP>
9821
+ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c ChannelTypeFeatures)> for FundedChannel <SP>
9822
9822
where
9823
9823
ES::Target: EntropySource,
9824
9824
SP::Target: SignerProvider
@@ -10291,7 +10291,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
10291
10291
},
10292
10292
};
10293
10293
10294
- Ok(Channel {
10294
+ Ok(FundedChannel {
10295
10295
context: ChannelContext {
10296
10296
user_id,
10297
10297
@@ -10449,7 +10449,7 @@ mod tests {
10449
10449
use crate::ln::channel_keys::{RevocationKey, RevocationBasepoint};
10450
10450
use crate::ln::channelmanager::{self, HTLCSource, PaymentId};
10451
10451
use crate::ln::channel::InitFeatures;
10452
- use crate::ln::channel::{AwaitingChannelReadyFlags, Channel, ChannelState , InboundHTLCOutput, OutboundV1Channel, InboundV1Channel, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator, HTLCUpdateAwaitingACK, commit_tx_fee_sat};
10452
+ use crate::ln::channel::{AwaitingChannelReadyFlags, ChannelState, FundedChannel , InboundHTLCOutput, OutboundV1Channel, InboundV1Channel, OutboundHTLCOutput, InboundHTLCState, OutboundHTLCState, HTLCCandidate, HTLCInitiator, HTLCUpdateAwaitingACK, commit_tx_fee_sat};
10453
10453
use crate::ln::channel::{MAX_FUNDING_SATOSHIS_NO_WUMBO, TOTAL_BITCOIN_SUPPLY_SATOSHIS, MIN_THEIR_CHAN_RESERVE_SATOSHIS};
10454
10454
use crate::types::features::{ChannelFeatures, ChannelTypeFeatures, NodeFeatures};
10455
10455
use crate::ln::msgs;
@@ -11115,7 +11115,7 @@ mod tests {
11115
11115
let mut s = crate::io::Cursor::new(&encoded_chan);
11116
11116
let mut reader = crate::util::ser::FixedLengthReader::new(&mut s, encoded_chan.len() as u64);
11117
11117
let features = channelmanager::provided_channel_type_features(&config);
11118
- let decoded_chan = Channel ::read(&mut reader, (&&keys_provider, &&keys_provider, 0, &features)).unwrap();
11118
+ let decoded_chan = FundedChannel ::read(&mut reader, (&&keys_provider, &&keys_provider, 0, &features)).unwrap();
11119
11119
assert_eq!(decoded_chan.context.pending_outbound_htlcs, pending_outbound_htlcs);
11120
11120
assert_eq!(decoded_chan.context.holding_cell_htlc_updates, holding_cell_htlc_updates);
11121
11121
}
0 commit comments