Skip to content

Commit b2bf57e

Browse files
committed
[bindings] Don't export new functions with unexportable types
`CommitmentTransaction::new_with_auxiliary_htlc_data()` includes a unbounded generic parameter which we can't concretize and it's of limited immediate use for users in any case. We should eventually add a non-generic version which uses `()` for the generic but that can come later. `CommitmentTransaction::htlcs()` returns a reference to a Vec, which we cannot currently map. It should, however, be exposed to users, so in the future we'll need to have a duplication function which returns Vec of references or a cloned Vec.
1 parent bec92d3 commit b2bf57e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,8 @@ impl CommitmentTransaction {
889889
/// This auxiliary data is not stored in this object.
890890
///
891891
/// Only include HTLCs that are above the dust limit for the channel.
892+
///
893+
/// (C-not exported) due to the generic though we likely should expose a version without
892894
pub fn new_with_auxiliary_htlc_data<T>(commitment_number: u64, to_broadcaster_value_sat: u64, to_countersignatory_value_sat: u64, keys: TxCreationKeys, feerate_per_kw: u32, htlcs_with_aux: &mut Vec<(HTLCOutputInCommitment, T)>, channel_parameters: &DirectedChannelTransactionParameters) -> CommitmentTransaction {
893895
// Sort outputs and populate output indices while keeping track of the auxiliary data
894896
let (outputs, htlcs) = Self::internal_build_outputs(&keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters).unwrap();
@@ -1056,6 +1058,9 @@ impl CommitmentTransaction {
10561058
/// The non-dust HTLCs (direction, amt, height expiration, hash, transaction output index)
10571059
/// which were included in this commitment transaction in output order.
10581060
/// The transaction index is always populated.
1061+
///
1062+
/// (C-not exported) as we cannot currently convert Vec references to/from C, though we should
1063+
/// expose a less effecient version which creates a Vec of references in the future.
10591064
pub fn htlcs(&self) -> &Vec<HTLCOutputInCommitment> {
10601065
&self.htlcs
10611066
}

0 commit comments

Comments
 (0)