Skip to content

Commit fd1a47a

Browse files
committed
Delete TrustedCommitmentTransaction::get_htlc_sigs
1 parent 2ed352c commit fd1a47a

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,8 @@ pub(crate) fn make_funding_redeemscript_from_slices(broadcaster_funding_key: &[u
698698
}
699699

700700
/// Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
701-
/// parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
702-
/// transaction which needs signing, and can be used to construct an HTLC transaction which is
703-
/// broadcastable given a counterparty HTLC signature.
701+
/// parameters. This is can be used to construct an HTLC transaction which is broadcastable given a
702+
/// counterparty HTLC signature.
704703
///
705704
/// Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
706705
/// commitment transaction).
@@ -1713,33 +1712,6 @@ impl<'a> TrustedCommitmentTransaction<'a> {
17131712
&self.inner.channel_type_features
17141713
}
17151714

1716-
/// Get a signature for each HTLC which was included in the commitment transaction (ie for
1717-
/// which HTLCOutputInCommitment::transaction_output_index.is_some()).
1718-
///
1719-
/// The returned Vec has one entry for each HTLC, and in the same order.
1720-
///
1721-
/// This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
1722-
pub fn get_htlc_sigs<T: secp256k1::Signing, ES: Deref>(
1723-
&self, htlc_base_key: &SecretKey, entropy_source: &ES, secp_ctx: &Secp256k1<T>, revokeable_spk: ScriptBuf,
1724-
) -> Result<Vec<Signature>, ()> where ES::Target: EntropySource {
1725-
let inner = self.inner;
1726-
let keys = &inner.keys;
1727-
let txid = inner.built.txid;
1728-
let mut ret = Vec::with_capacity(inner.htlcs.len());
1729-
let holder_htlc_key = derive_private_key(secp_ctx, &inner.keys.per_commitment_point, htlc_base_key);
1730-
1731-
for this_htlc in inner.htlcs.iter() {
1732-
assert!(this_htlc.transaction_output_index.is_some());
1733-
let htlc_tx = build_htlc_transaction(&txid, inner.feerate_per_kw, &this_htlc, &self.channel_type_features, revokeable_spk.clone());
1734-
1735-
let htlc_redeemscript = get_htlc_redeemscript_with_explicit_keys(&this_htlc, &self.channel_type_features, &keys.broadcaster_htlc_key, &keys.countersignatory_htlc_key, &keys.revocation_key);
1736-
1737-
let sighash = hash_to_message!(&sighash::SighashCache::new(&htlc_tx).p2wsh_signature_hash(0, &htlc_redeemscript, this_htlc.to_bitcoin_amount(), EcdsaSighashType::All).unwrap()[..]);
1738-
ret.push(sign_with_aux_rand(secp_ctx, &sighash, &holder_htlc_key, entropy_source));
1739-
}
1740-
Ok(ret)
1741-
}
1742-
17431715
/// Builds the second-level holder HTLC transaction for the HTLC with index `htlc_index`.
17441716
pub(crate) fn build_unsigned_htlc_tx(&self, htlc_index: usize, preimage: &Option<PaymentPreimage>, revokeable_spk: ScriptBuf) -> Transaction {
17451717
let this_htlc = &self.inner.htlcs[htlc_index];

0 commit comments

Comments
 (0)