core/state: do not unmarshal Unclaimed balances in account

This commit is contained in:
Evgenii Stratonikov 2020-03-13 13:54:13 +03:00
parent 8cb9e1d85d
commit e503d1001d
6 changed files with 174 additions and 21 deletions

View file

@ -379,7 +379,13 @@ func (s *Server) getClaimable(ps request.Params) (interface{}, error) {
var unclaimed []state.UnclaimedBalance
if acc := s.chain.GetAccountState(u); acc != nil {
unclaimed = acc.Unclaimed
err := acc.Unclaimed.ForEach(func(b *state.UnclaimedBalance) error {
unclaimed = append(unclaimed, *b)
return nil
})
if err != nil {
return nil, err
}
}
var sum util.Fixed8