Skip to content

Commit 700b72b

Browse files
committed
nits
1 parent 814fd79 commit 700b72b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ pub struct CommitmentTransactionInfo {
685685
pub feerate_per_kw: u32,
686686
/// The HTLCs which were included in this commitment transaction in output order.
687687
pub htlcs: Vec<HTLCOutputInCommitment>,
688+
// A cache of pubkeys required to construct the transaction
688689
pub(crate) keys: TxCreationKeys,
689690
}
690691

@@ -771,8 +772,6 @@ impl CommitmentTransactionInfo {
771772
/// Build the Bitcoin transaction.
772773
///
773774
/// 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
776775
pub fn build<T: secp256k1::Signing + secp256k1::Verification>(
777776
&self,
778777
holder: bool,
@@ -871,6 +870,8 @@ impl CommitmentTransactionInfo {
871870
txouts.push((txout, (script, Some((htlc.clone(), *t)))));
872871
}
873872

873+
// Sort output in BIP-69 order (amount, scriptPubkey). Tie-breaks based on HTLC
874+
// CLTV expiration height.
874875
sort_outputs(&mut txouts, |a, b| {
875876
if let &(_, Some(ref a_htlcout)) = a {
876877
if let &(_, Some(ref b_htlcout)) = b {
@@ -917,7 +918,7 @@ impl CommitmentTransactionInfo {
917918
secp_ctx.sign(&sighash, funding_key)
918919
}
919920

920-
/// Get the sighash and the transaction.
921+
/// Get the SIGHASH_ALL sighash value and the transaction.
921922
///
922923
/// Builds the transaction and computes the sighash. This can be used to verify a signature.
923924
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

Comments
 (0)