From 0530d69e7f510afa798d647e2880db462de2b699 Mon Sep 17 00:00:00 2001 From: Lokraan Date: Tue, 9 Oct 2018 11:51:08 -0500 Subject: [PATCH] Doesn't count every sibling unecessarily. In where_transaction_has_multiple_internal_transactions it counts every sibling uncessarily, I added a limit to it so it only selects up to 2. --- apps/explorer/lib/explorer/chain.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 3cc672bb25..8b6798fd0c 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -1816,7 +1816,9 @@ defmodule Explorer.Chain do """ (SELECT COUNT(sibling.id) FROM internal_transactions AS sibling - WHERE sibling.transaction_hash = ?) + WHERE sibling.transaction_hash = ? + LIMIT 2 + ) """, transaction.hash ) > 1