From: Antoine Riard Date: Tue, 5 May 2020 22:48:32 +0000 (-0400) Subject: Make get_revokable_redeemscript X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=82b9a2761f33d9ad9f53845565584c18974847f5;p=rust-lightning Make get_revokable_redeemscript --- diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index f4baf668f..d50cc1f41 100644 --- a/lightning/src/ln/chan_utils.rs +++ b/lightning/src/ln/chan_utils.rs @@ -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)