remove update of block number for internal transactions

pull/2693/head
Ayrat Badykov 5 years ago
parent 9e4b234412
commit d7c62b2a5a
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 25
      apps/explorer/lib/explorer/chain/import/runner/blocks.ex

@ -131,31 +131,6 @@ defmodule Explorer.Chain.Import.Runner.Blocks do
}
)
end)
|> Multi.run(
:internal_transaction_transaction_block_number,
fn repo, %{blocks: blocks} ->
blocks_hashes = Enum.map(blocks, & &1.hash)
query =
from(
internal_transaction in InternalTransaction,
join: transaction in Transaction,
on: internal_transaction.transaction_hash == transaction.hash,
join: block in Block,
on: block.hash == transaction.block_hash,
where: block.hash in ^blocks_hashes,
update: [
set: [
block_number: block.number
]
]
)
{total, _} = repo.update_all(query, [])
{:ok, total}
end
)
end
@impl Runner

Loading…
Cancel
Save