Skip to content

Commit 8f452b4

Browse files
committed
Clean up docs on public chan_utils methods to be more useful
1 parent 3996eaa commit 8f452b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ pub fn make_funding_redeemscript(broadcaster: &PublicKey, countersignatory: &Pub
525525
}.push_opcode(opcodes::all::OP_PUSHNUM_2).push_opcode(opcodes::all::OP_CHECKMULTISIG).into_script()
526526
}
527527

528-
/// panics if htlc.transaction_output_index.is_none()!
528+
/// Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
529+
/// parameters.
530+
///
531+
/// Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
532+
/// commitment transaction).
529533
pub fn build_htlc_transaction(prev_hash: &Txid, feerate_per_kw: u32, contest_delay: u16, htlc: &HTLCOutputInCommitment, broadcaster_delayed_payment_key: &PublicKey, revocation_key: &PublicKey) -> Transaction {
530534
let mut txins: Vec<TxIn> = Vec::new();
531535
txins.push(TxIn {
@@ -1177,7 +1181,11 @@ impl<'a> TrustedCommitmentTransaction<'a> {
11771181
}
11781182
}
11791183

1180-
/// Get the transaction number obscure factor
1184+
/// Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
1185+
/// shared secret first. This prevents on-chain observers from discovering how many commitment
1186+
/// transactions occurred in a channel before it was closed.
1187+
///
1188+
/// This function gets the shared secret from relevant channel public keys.
11811189
pub fn get_commitment_transaction_number_obscure_factor(
11821190
broadcaster_payment_basepoint: &PublicKey,
11831191
countersignatory_payment_basepoint: &PublicKey,

0 commit comments

Comments
 (0)