@@ -687,7 +687,7 @@ impl UnfundedChannelContext {
687
687
}
688
688
689
689
/// Contains everything about the channel including state, and various flags.
690
- pub(super ) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
690
+ pub(crate ) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
691
691
config: LegacyChannelConfig,
692
692
693
693
// Track the previous `ChannelConfig` so that we can continue forwarding HTLCs that were
@@ -700,7 +700,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
700
700
user_id: u128,
701
701
702
702
/// The current channel ID.
703
- channel_id: ChannelId,
703
+ pub(crate) channel_id: ChannelId,
704
704
/// The temporary channel ID used during channel setup. Value kept even after transitioning to a final channel ID.
705
705
/// Will be `None` for channels created prior to 0.0.115.
706
706
temporary_channel_id: Option<ChannelId>,
@@ -915,7 +915,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
915
915
historical_inbound_htlc_fulfills: HashSet<u64>,
916
916
917
917
/// This channel's type, as negotiated during channel open
918
- channel_type: ChannelTypeFeatures,
918
+ pub(crate) channel_type: ChannelTypeFeatures,
919
919
920
920
// Our counterparty can offer us SCID aliases which they will map to this channel when routing
921
921
// outbound payments. These can be used in invoice route hints to avoid explicitly revealing
@@ -952,7 +952,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
952
952
/// The consignment endpoint used to exchange the RGB consignment
953
953
pub(super) consignment_endpoint: Option<RgbTransport>,
954
954
955
- ldk_data_dir: PathBuf,
955
+ pub(crate) ldk_data_dir: PathBuf,
956
956
}
957
957
958
958
impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
@@ -1108,7 +1108,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1108
1108
self.channel_transaction_parameters.holder_selected_contest_delay
1109
1109
}
1110
1110
1111
- fn get_holder_pubkeys(&self) -> &ChannelPublicKeys {
1111
+ pub(crate) fn get_holder_pubkeys(&self) -> &ChannelPublicKeys {
1112
1112
&self.channel_transaction_parameters.holder_pubkeys
1113
1113
}
1114
1114
@@ -1117,7 +1117,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
1117
1117
.as_ref().map(|params| params.selected_contest_delay)
1118
1118
}
1119
1119
1120
- fn get_counterparty_pubkeys(&self) -> &ChannelPublicKeys {
1120
+ pub(crate) fn get_counterparty_pubkeys(&self) -> &ChannelPublicKeys {
1121
1121
&self.channel_transaction_parameters.counterparty_parameters.as_ref().unwrap().pubkeys
1122
1122
}
1123
1123
@@ -2606,7 +2606,7 @@ impl<SP: Deref> Channel<SP> where
2606
2606
let counterparty_keys = self.context.build_remote_transaction_keys();
2607
2607
let mut counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
2608
2608
if self.context.is_colored() {
2609
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut counterparty_initial_commitment_tx, &self.context.ldk_data_dir , true)?;
2609
+ color_commitment(&self.context, &mut counterparty_initial_commitment_tx, true)?;
2610
2610
}
2611
2611
let counterparty_trusted_tx = counterparty_initial_commitment_tx.trust();
2612
2612
let counterparty_initial_bitcoin_tx = counterparty_trusted_tx.built_transaction();
@@ -2617,7 +2617,7 @@ impl<SP: Deref> Channel<SP> where
2617
2617
let holder_signer = self.context.build_holder_transaction_keys(self.context.cur_holder_commitment_transaction_number);
2618
2618
let mut initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_holder_commitment_transaction_number, &holder_signer, true, false, logger).tx;
2619
2619
if self.context.is_colored() {
2620
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut initial_commitment_tx, &self.context.ldk_data_dir , false)?;
2620
+ color_commitment(&self.context, &mut initial_commitment_tx, false)?;
2621
2621
}
2622
2622
{
2623
2623
let trusted_tx = initial_commitment_tx.trust();
@@ -3023,7 +3023,7 @@ impl<SP: Deref> Channel<SP> where
3023
3023
3024
3024
let mut commitment_stats = self.context.build_commitment_transaction(self.context.cur_holder_commitment_transaction_number, &keys, true, false, logger);
3025
3025
if self.context.is_colored() {
3026
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut commitment_stats.tx, &self.context.ldk_data_dir , false)?;
3026
+ color_commitment(&self.context, &mut commitment_stats.tx, false)?;
3027
3027
}
3028
3028
let commitment_txid = {
3029
3029
let trusted_tx = commitment_stats.tx.trust();
@@ -3682,7 +3682,7 @@ impl<SP: Deref> Channel<SP> where
3682
3682
let keys = self.context.build_holder_transaction_keys(self.context.cur_holder_commitment_transaction_number);
3683
3683
let mut commitment_stats = self.context.build_commitment_transaction(self.context.cur_holder_commitment_transaction_number, &keys, true, true, logger);
3684
3684
if self.context.is_colored() {
3685
- if let Err(e) = color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut commitment_stats.tx, &self.context.ldk_data_dir , false) {
3685
+ if let Err(e) = color_commitment(&self.context, &mut commitment_stats.tx, false) {
3686
3686
log_error!(logger, "Cannot color commitment: {e:?}");
3687
3687
return None;
3688
3688
}
@@ -5541,7 +5541,7 @@ impl<SP: Deref> Channel<SP> where
5541
5541
let counterparty_keys = self.context.build_remote_transaction_keys();
5542
5542
let mut commitment_stats = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
5543
5543
if self.context.is_colored() {
5544
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut commitment_stats.tx, &self.context.ldk_data_dir , true).expect("successful commitment coloring");
5544
+ color_commitment(&self.context, &mut commitment_stats.tx, true).expect("successful commitment coloring");
5545
5545
}
5546
5546
let counterparty_commitment_tx = commitment_stats.tx;
5547
5547
@@ -5576,7 +5576,7 @@ impl<SP: Deref> Channel<SP> where
5576
5576
let counterparty_keys = self.context.build_remote_transaction_keys();
5577
5577
let mut commitment_stats = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, true, logger);
5578
5578
if self.context.is_colored() {
5579
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut commitment_stats.tx, &self.context.ldk_data_dir , true)?;
5579
+ color_commitment(&self.context, &mut commitment_stats.tx, true)?;
5580
5580
}
5581
5581
let counterparty_commitment_txid = commitment_stats.tx.trust().txid();
5582
5582
@@ -5995,7 +5995,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
5995
5995
let counterparty_keys = self.context.build_remote_transaction_keys();
5996
5996
let mut counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
5997
5997
if self.context.is_colored() {
5998
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut counterparty_initial_commitment_tx, &self.context.ldk_data_dir , true)?;
5998
+ color_commitment(&self.context, &mut counterparty_initial_commitment_tx, true)?;
5999
5999
}
6000
6000
match &self.context.holder_signer {
6001
6001
// TODO (taproot|arik): move match into calling method for Taproot
@@ -6727,7 +6727,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
6727
6727
let keys = self.context.build_holder_transaction_keys(self.context.cur_holder_commitment_transaction_number);
6728
6728
let mut initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_holder_commitment_transaction_number, &keys, true, false, logger).tx;
6729
6729
if self.context.is_colored() {
6730
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut initial_commitment_tx, &self.context.ldk_data_dir , false)?;
6730
+ color_commitment(&self.context, &mut initial_commitment_tx, false)?;
6731
6731
}
6732
6732
{
6733
6733
let trusted_tx = initial_commitment_tx.trust();
@@ -6744,7 +6744,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
6744
6744
let counterparty_keys = self.context.build_remote_transaction_keys();
6745
6745
let mut counterparty_initial_commitment_tx = self.context.build_commitment_transaction(self.context.cur_counterparty_commitment_transaction_number, &counterparty_keys, false, false, logger).tx;
6746
6746
if self.context.is_colored() {
6747
- color_commitment(&self.context.channel_id , &self.context.channel_transaction_parameters.funding_outpoint.unwrap(), & mut counterparty_initial_commitment_tx, &self.context.ldk_data_dir , true)?;
6747
+ color_commitment(&self.context, &mut counterparty_initial_commitment_tx, true)?;
6748
6748
}
6749
6749
6750
6750
let counterparty_trusted_tx = counterparty_initial_commitment_tx.trust();
0 commit comments