@@ -685,6 +685,7 @@ pub struct CommitmentTransactionInfo {
685
685
pub feerate_per_kw : u32 ,
686
686
/// The HTLCs which were included in this commitment transaction in output order.
687
687
pub htlcs : Vec < HTLCOutputInCommitment > ,
688
+ // A cache of pubkeys required to construct the transaction
688
689
pub ( crate ) keys : TxCreationKeys ,
689
690
}
690
691
@@ -771,8 +772,6 @@ impl CommitmentTransactionInfo {
771
772
/// Build the Bitcoin transaction.
772
773
///
773
774
/// Required channel-static fields are provided by the caller.
774
- ///
775
- /// is_outbound is true if the channel is outbound from the point of view of the broadcaster
776
775
pub fn build < T : secp256k1:: Signing + secp256k1:: Verification > (
777
776
& self ,
778
777
holder : bool ,
@@ -871,6 +870,8 @@ impl CommitmentTransactionInfo {
871
870
txouts. push ( ( txout, ( script, Some ( ( htlc. clone ( ) , * t) ) ) ) ) ;
872
871
}
873
872
873
+ // Sort output in BIP-69 order (amount, scriptPubkey). Tie-breaks based on HTLC
874
+ // CLTV expiration height.
874
875
sort_outputs ( & mut txouts, |a, b| {
875
876
if let & ( _, Some ( ref a_htlcout) ) = a {
876
877
if let & ( _, Some ( ref b_htlcout) ) = b {
@@ -917,7 +918,7 @@ impl CommitmentTransactionInfo {
917
918
secp_ctx. sign ( & sighash, funding_key)
918
919
}
919
920
920
- /// Get the sighash and the transaction.
921
+ /// Get the SIGHASH_ALL sighash value and the transaction.
921
922
///
922
923
/// Builds the transaction and computes the sighash. This can be used to verify a signature.
923
924
pub fn get_sighash < T : secp256k1:: Signing + secp256k1:: Verification > ( & self , holder : bool , channel_static_info : & ChannelStaticInfo , funding_redeemscript : & Script , channel_value_satoshis : u64 , secp_ctx : & Secp256k1 < T > ) -> ( Message , Transaction ) {
0 commit comments