From: Matt Corallo Date: Tue, 17 Aug 2021 19:47:50 +0000 (+0000) Subject: Clarify docs on ShutdownScript::new_witness_program somewhat X-Git-Tag: v0.0.101~34^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=commitdiff_plain;h=35d0b7aae73760df48f814db6ce4b72e8ee5523a 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`. --- 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 ///