core: fix CalculateClaimable for NEP5 NEO

It's not stored as Fixed8, so calculations need to be adjusted for that.
This commit is contained in:
Roman Khimov 2020-06-04 23:16:43 +03:00
parent 39dfebccc4
commit 3d18f09def
7 changed files with 28 additions and 18 deletions

View file

@ -821,8 +821,8 @@ func (s *Server) getUnclaimedGas(ps request.Params) (interface{}, *response.Erro
if neo == 0 {
return "0", nil
}
gas := s.chain.CalculateClaimable(neo, neoHeight, s.chain.BlockHeight()+1) // +1 as in C#, for the next block.
return strconv.FormatInt(int64(gas), 10), nil // It's not represented as Fixed8 in C#.
gas := s.chain.CalculateClaimable(int64(neo), neoHeight, s.chain.BlockHeight()+1) // +1 as in C#, for the next block.
return strconv.FormatInt(int64(gas), 10), nil // It's not represented as Fixed8 in C#.
}
// getValidators returns the current NEO consensus nodes information and voting status.