Remove useless build warnings
[rust-lightning] / lightning / src / ln / chan_utils.rs
index e619716a3cc8cfea5cd4c4688da6f5dad5056729..d50cc1f41b6f10e7f94be49c9244692f68130cf3 100644 (file)
@@ -171,9 +171,10 @@ impl Readable for CounterpartyCommitmentSecrets {
        }
 }
 
-/// Derives a per-commitment-transaction private key (eg an htlc key or payment key) from the base
+/// Derives a per-commitment-transaction private key (eg an htlc key, payment key or delayed_payment
+/// key) from the base.
 /// private key for that type of key and the per_commitment_point (available in TxCreationKeys)
-pub(crate) fn derive_private_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result<SecretKey, secp256k1::Error> {
+pub fn derive_private_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result<SecretKey, secp256k1::Error> {
        let mut sha = Sha256::engine();
        sha.input(&per_commitment_point.serialize());
        sha.input(&PublicKey::from_secret_key(&secp_ctx, &base_secret).serialize());
@@ -311,9 +312,10 @@ impl TxCreationKeys {
        }
 }
 
-/// Gets the "to_local" output redeemscript, ie the script which is time-locked or spendable by
-/// the revocation key
-pub(crate) fn get_revokeable_redeemscript(revocation_key: &PublicKey, to_self_delay: u16, delayed_payment_key: &PublicKey) -> Script {
+/// A script either spendable by the revocation
+/// key or the delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
+/// Encumbering a `to_local` output on a commitment transaction or 2nd-stage HTLC transactions.
+pub fn get_revokeable_redeemscript(revocation_key: &PublicKey, to_self_delay: u16, delayed_payment_key: &PublicKey) -> Script {
        Builder::new().push_opcode(opcodes::all::OP_IF)
                      .push_slice(&revocation_key.serialize())
                      .push_opcode(opcodes::all::OP_ELSE)