From 9b5809a884bdad32e0fe9c7c1629d727d594f08a Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 6 Jan 2020 11:42:04 +0100 Subject: [PATCH] input: update SignDescriptor doc to note only segwit is supported Also update the WitnessScript doc to note it should be set also for p2wkh. --- input/signdescriptor.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/input/signdescriptor.go b/input/signdescriptor.go index 0dfb5d46..2aa2af9c 100644 --- a/input/signdescriptor.go +++ b/input/signdescriptor.go @@ -17,9 +17,9 @@ var ( ErrTweakOverdose = errors.New("sign descriptor should only have one tweak") ) -// SignDescriptor houses the necessary information required to successfully sign -// a given output. This struct is used by the Signer interface in order to gain -// access to critical data needed to generate a valid signature. +// SignDescriptor houses the necessary information required to successfully +// sign a given segwit output. This struct is used by the Signer interface in +// order to gain access to critical data needed to generate a valid signature. type SignDescriptor struct { // KeyDesc is a descriptor that precisely describes *which* key to use // for signing. This may provide the raw public key directly, or @@ -56,8 +56,9 @@ type SignDescriptor struct { DoubleTweak *btcec.PrivateKey // WitnessScript is the full script required to properly redeem the - // output. This field will only be populated if a p2wsh or a p2sh - // output is being signed. + // output. This field should be set to the full script if a p2wsh + // output is being signed. For p2wkh it should be set to the hashed + // script (PkScript). WitnessScript []byte // Output is the target output which should be signed. The PkScript and