fix formatKeyID

pull/541/head
sidhujag 2020-09-08 08:09:46 -07:00
parent fbbf11b8b2
commit d38da01f71
1 changed files with 8 additions and 1 deletions

View File

@ -579,8 +579,15 @@ func formatPercentage(a string) string {
}
func (s *PublicServer) formatKeyID(a string) string {
addr, err := s.chainParser.WitnessPubKeyHashFromKeyID([]byte(a))
dst := make([]byte, hex.DecodedLen(len(a)))
_, errDecode := hex.Decode(dst, a)
if errDecode != nil {
glog.Error(errDecode)
return ""
}
addr, err := s.chainParser.WitnessPubKeyHashFromKeyID(dst)
if err != nil {
glog.Error(err)
return ""
}
return addr