Skip to content

Commit

Permalink
Add uniq filter on UTXO list while DB write
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Feb 3, 2025
1 parent d650264 commit 355aa4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/archethic/utxo/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 355aa4f

Please sign in to comment.