]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make get_revokable_redeemscript
authorAntoine Riard <ariard@student.42.fr>
Tue, 5 May 2020 22:48:32 +0000 (18:48 -0400)
committerAntoine Riard <ariard@student.42.fr>
Thu, 28 May 2020 08:21:47 +0000 (04:21 -0400)
lightning/src/ln/chan_utils.rs

index f4baf668f5651a4a62690ffe583a9a36b5a54176..d50cc1f41b6f10e7f94be49c9244692f68130cf3 100644 (file)
@@ -312,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)