diff --git a/apps/explorer/lib/explorer/chain/import/runner/block/rewards.ex b/apps/explorer/lib/explorer/chain/import/runner/block/rewards.ex index 3ce55fbf07..2ada9eaa7d 100644 --- a/apps/explorer/lib/explorer/chain/import/runner/block/rewards.ex +++ b/apps/explorer/lib/explorer/chain/import/runner/block/rewards.ex @@ -53,7 +53,11 @@ defmodule Explorer.Chain.Import.Runner.Block.Rewards do on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0) # order so that row ShareLocks are grabbed in a consistent order - ordered_changes_list = Enum.sort_by(changes_list, &{&1.address_hash, &1.address_type, &1.block_hash}) + ordered_changes_list = + changes_list + |> Enum.uniq_by(&{&1.address_hash, &1.address_type, &1.block_hash}) + |> Enum.sort_by(&{&1.address_hash, &1.address_type, &1.block_hash}) + Import.insert_changes_list( repo,