Clarify docs on ShutdownScript::new_witness_program somewhat 2021-08-no-net-print
authorMatt Corallo <git@bluematt.me>
Tue, 17 Aug 2021 19:47:50 +0000 (19:47 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 17 Aug 2021 21:12:06 +0000 (21:12 +0000)
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

index 3abb334ce478878d154f98b618df1c6ea6e1affe..4e81d76ad670d18b2c8b172d4acd94ea62c64607 100644 (file)
@@ -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
        ///