Fix error message informing about missing Ethereum xpub support #314

balanceHistory
Martin Boehm 2019-11-19 11:56:40 +01:00
parent 5600e0d30a
commit da714b5299
1 changed files with 6 additions and 0 deletions

View File

@ -684,6 +684,9 @@ func (s *PublicServer) explorerXpub(w http.ResponseWriter, r *http.Request) (tpl
// do not allow txsOnPage and details to be changed by query params
address, err := s.api.GetXpubAddress(xpub, page, txsOnPage, api.AccountDetailsTxHistoryLight, filter, gap)
if err != nil {
if err == api.ErrUnsupportedXpub {
err = api.NewAPIError("XPUB functionality is not supported", true)
}
return errorTpl, nil, err
}
data := s.newTemplateData()
@ -994,6 +997,9 @@ func (s *PublicServer) apiXpub(r *http.Request, apiVersion int) (interface{}, er
if err == nil && apiVersion == apiV1 {
return s.api.AddressToV1(address), nil
}
if err == api.ErrUnsupportedXpub {
err = api.NewAPIError("XPUB functionality is not supported", true)
}
return address, err
}