From 265fe7417067408a8106128c18afafbd8072f38e Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 29 Jul 2019 15:49:32 +0300 Subject: [PATCH] fix top addresses query --- apps/explorer/lib/explorer/chain.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index c2e480957d..daf4974bce 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/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