From 35d0b7aae73760df48f814db6ce4b72e8ee5523a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 17 Aug 2021 19:47:50 +0000 Subject: [PATCH] Clarify docs on ShutdownScript::new_witness_program somewhat This is especially important for C or other language bindings clients as the `version` field may be exported as a `u8`. --- lightning/src/ln/script.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/script.rs b/lightning/src/ln/script.rs index 3abb334c..4e81d76a 100644 --- a/lightning/src/ln/script.rs +++ b/lightning/src/ln/script.rs @@ -86,7 +86,10 @@ impl ShutdownScript { Self(ShutdownScriptImpl::Bolt2(Script::new_v0_wsh(script_hash))) } - /// Generates a P2WSH script pubkey from the given segwit version and program. + /// Generates a witness script pubkey from the given segwit version and program. + /// + /// Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or + /// [`ShutdownScript::new_p2wsh`] instead. /// /// # Errors /// -- 2.30.2