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?a=commitdiff_plain;h=refs%2Fheads%2F2021-08-no-net-print;p=rust-lightning 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 3abb334ce..4e81d76ad 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 ///