Remove balance calc for explorer

pull/1632/head
flicker-harmony 5 years ago
parent 498fc457c8
commit eeae152abc
  1. 9
      api/service/explorer/storage.go

@ -170,14 +170,9 @@ func (storage *Storage) UpdateAddressStorage(batch ethdb.Batch, addr string, exp
var address Address
if data, err := storage.db.Get([]byte(key)); err == nil {
err = rlp.DecodeBytes(data, &address)
if err == nil {
address.Balance.Add(address.Balance, tx.Value())
} else {
utils.Logger().Error().Err(err).Msg("Failed to error")
if err = rlp.DecodeBytes(data, &address); err != nil {
utils.Logger().Error().Err(err).Msg("Failed due to error")
}
} else {
address.Balance = tx.Value()
}
address.ID = addr
address.TXs = append(address.TXs, explorerTransaction)

Loading…
Cancel
Save