OSDN Git Service

init push for pay-to-script-hash (#235)
[bytom/bytom.git] / common / address.go
index 0d99eb1..4c81d94 100644 (file)
@@ -209,8 +209,7 @@ func newAddressWitnessPubKeyHash(hrp string, witnessProg []byte) (*AddressWitnes
        // 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{
@@ -300,8 +299,7 @@ func newAddressWitnessScriptHash(hrp string, witnessProg []byte) (*AddressWitnes
        // 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{
@@ -363,7 +361,7 @@ func (a *AddressWitnessScriptHash) WitnessProgram() []byte {
        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