diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index d2fe1d19d5..42c79ad0c7 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -1987,7 +1987,6 @@ defmodule Explorer.Chain do |> page_pending_transaction(paging_options) |> limit(^paging_options.page_size) |> pending_transactions_query() - |> where([transaction], is_nil(transaction.error) or transaction.error != "dropped/replaced") |> order_by([transaction], desc: transaction.inserted_at, desc: transaction.hash) |> join_associations(necessity_by_association) |> preload([{:token_transfers, [:token, :from_address, :to_address]}]) @@ -1996,7 +1995,7 @@ defmodule Explorer.Chain do defp pending_transactions_query(query) do from(transaction in query, - where: is_nil(transaction.block_hash) + where: is_nil(transaction.block_hash) and (is_nil(transaction.error) or transaction.error != "dropped/replaced") ) end diff --git a/apps/explorer/priv/repo/migrations/20190613065856_add_tx_hash_inserted_at_index.exs b/apps/explorer/priv/repo/migrations/20190613065856_add_tx_hash_inserted_at_index.exs new file mode 100644 index 0000000000..a81d87f392 --- /dev/null +++ b/apps/explorer/priv/repo/migrations/20190613065856_add_tx_hash_inserted_at_index.exs @@ -0,0 +1,7 @@ +defmodule Explorer.Repo.Migrations.AddTxHashInsertedAtIndex do + use Ecto.Migration + + def change do + create index(:transactions, [:hash, :inserted_at]) + end +end