From 12f789a96df5c0e100ca52b37e70d3d119d0c2f7 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Tue, 25 Sep 2018 10:24:14 -0500 Subject: [PATCH] Use hash for Block conflict_target As the consensus block and zero or more non-consensus (uncle) blocks can have the same number now, number is no longer unique and not a good conflict_target, so switch to hash. --- apps/explorer/lib/explorer/chain/import.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain/import.ex b/apps/explorer/lib/explorer/chain/import.ex index cc1e99e16b..2704fa4157 100644 --- a/apps/explorer/lib/explorer/chain/import.ex +++ b/apps/explorer/lib/explorer/chain/import.ex @@ -724,7 +724,7 @@ defmodule Explorer.Chain.Import do {:ok, blocks} = insert_changes_list( ordered_changes_list, - conflict_target: :number, + conflict_target: :hash, on_conflict: :replace_all, for: Block, returning: true,