From 355aa4f5958c76e4f4432f194ae7b6594c32c938 Mon Sep 17 00:00:00 2001 From: Neylix Date: Fri, 31 Jan 2025 18:45:37 +0100 Subject: [PATCH] Add uniq filter on UTXO list while DB write --- lib/archethic/utxo/loader.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/archethic/utxo/loader.ex b/lib/archethic/utxo/loader.ex index 07bc6557e..bbaa5b93b 100644 --- a/lib/archethic/utxo/loader.ex +++ b/lib/archethic/utxo/loader.ex @@ -114,7 +114,8 @@ defmodule Archethic.UTXO.Loader do genesis_address |> UTXO.stream_unspent_outputs() |> Stream.reject(&Enum.member?(consumed_inputs, &1.unspent_output)) - |> Enum.concat(transaction_unspent_outputs) + |> Stream.concat(transaction_unspent_outputs) + |> Enum.uniq() # We compact all the unspent outputs into new ones, cleaning the previous unspent outputs DBLedger.flush(genesis_address, new_unspent_outputs)