fix top addresses query

pull/2459/head
Ayrat Badykov 5 years ago
parent 053a84e566
commit 265fe74170
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 3
      apps/explorer/lib/explorer/chain.ex

@ -2601,7 +2601,8 @@ defmodule Explorer.Chain do
defp page_addresses(query, %PagingOptions{key: nil}), do: query
defp page_addresses(query, %PagingOptions{key: {coin_balance, hash}}) do
where(query, [address], address.fetched_coin_balance <= ^coin_balance and address.hash > ^hash)
from(address in query,
where: (address.fetched_coin_balance == ^coin_balance and address.hash > ^hash) or (address.fetched_coin_balance > ^coin_balance))
end
defp page_blocks(query, %PagingOptions{key: nil}), do: query

Loading…
Cancel
Save