From 14a594fd7896cb56943f04df5c53435ac8b394e3 Mon Sep 17 00:00:00 2001 From: bchamagne Date: Fri, 16 Feb 2024 12:00:54 +0100 Subject: [PATCH] fix migration when there is no transaction in a chain --- priv/migration_tasks/prod/1.4.8@aeip_21-1.exs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/priv/migration_tasks/prod/1.4.8@aeip_21-1.exs b/priv/migration_tasks/prod/1.4.8@aeip_21-1.exs index aabc4427f..d41f10519 100644 --- a/priv/migration_tasks/prod/1.4.8@aeip_21-1.exs +++ b/priv/migration_tasks/prod/1.4.8@aeip_21-1.exs @@ -75,11 +75,12 @@ defmodule Migration_1_4_8 do do: fetch_transaction(last_chain_address, authorized_nodes), else: nil - unless TransactionChain.transaction_exists?(last_chain_address) do - Replication.sync_transaction_chain(last_transaction, genesis_address, authorized_nodes, - self_repair: true - ) - end + if not is_nil(last_transaction) && not TransactionChain.transaction_exists?(last_chain_address) do + Replication.sync_transaction_chain(last_transaction, genesis_address, authorized_nodes, + self_repair: true + ) + end + inputs = fetch_transaction_inputs(last_chain_address, authorized_nodes)