// Check for valid program length for witness version 0, which is 20
// for P2WPKH.
if len(witnessProg) != 20 {
- return nil, errors.New("witness program must be 20 " +
- "bytes for p2wpkh")
+ return nil, errors.New("witness program must be 20 bytes for p2wpkh")
}
addr := &AddressWitnessPubKeyHash{
// Check for valid program length for witness version 0, which is 32
// for P2WSH.
if len(witnessProg) != 32 {
- return nil, errors.New("witness program must be 32 " +
- "bytes for p2wsh")
+ return nil, errors.New("witness program must be 32 bytes for p2wsh")
}
addr := &AddressWitnessScriptHash{
return a.witnessProgram[:]
}
-// Hash160 returns the witness program of the AddressWitnessPubKeyHash as a
+// Sha256 returns the witness program of the AddressWitnessPubKeyHash as a
// byte array.
func (a *AddressWitnessScriptHash) Sha256() *[32]byte {
return &a.witnessProgram