Make ErrHashStrSize slightly more descriptive.
Add the word 'string' to the error string so if this is printed, it will be clearer that it was a hash string decode that failed (as opposed to other errors creating a ShaHash from a byte slice) and change 'chars' to 'bytes', since the string length is measured in bytes, not UTF-8 code points. ok @davecgh
This commit is contained in:
parent
225248d283
commit
0127b3aafe
1 changed files with 1 additions and 1 deletions
|
@ -18,7 +18,7 @@ const MaxHashStringSize = HashSize * 2
|
||||||
|
|
||||||
// ErrHashStrSize describes an error that indicates the caller specified a hash
|
// ErrHashStrSize describes an error that indicates the caller specified a hash
|
||||||
// string that has too many characters.
|
// string that has too many characters.
|
||||||
var ErrHashStrSize = fmt.Errorf("max hash length is %v chars", MaxHashStringSize)
|
var ErrHashStrSize = fmt.Errorf("max hash string length is %v bytes", MaxHashStringSize)
|
||||||
|
|
||||||
// ShaHash is used in several of the bitcoin messages and common structures. It
|
// ShaHash is used in several of the bitcoin messages and common structures. It
|
||||||
// typically represents the double sha256 of data.
|
// typically represents the double sha256 of data.
|
||||||
|
|
Loading…
Reference in a new issue