core: store nep5balances using contract id

Closes #1194
This commit is contained in:
Anna Shaleva 2020-07-28 12:23:58 +03:00
parent 1f5794b316
commit b9bdab8ec8
7 changed files with 30 additions and 78 deletions

View file

@ -515,7 +515,11 @@ func (s *Server) getNEP5Balances(ps request.Params) (interface{}, *response.Erro
}
if as != nil {
cache := make(map[util.Uint160]int64)
for h, bal := range as.Trackers {
for id, bal := range as.Trackers {
h, err := s.chain.GetContractScriptHash(id)
if err != nil {
continue
}
dec, err := s.getDecimals(h, cache)
if err != nil {
continue