base58: fix Base58Decode on calculating the zeroBytes

The leading "zeroBytes" in address is b58Alphabet[0] instead of 0x00.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
This commit is contained in:
Wei Yang 2017-10-16 21:46:01 +08:00
parent 5e43c770ee
commit cee6700c21
1 changed files with 3 additions and 1 deletions

View File

@ -40,8 +40,10 @@ func Base58Decode(input []byte) []byte {
zeroBytes := 0
for _, b := range input {
if b == 0x00 {
if b == b58Alphabet[0] {
zeroBytes++
} else {
break
}
}