diff --git a/modules/chain/dap_chain_ledger.c b/modules/chain/dap_chain_ledger.c
index a5ac3b20fe8a44818fd8744a4ab4e6e98d2988ba..5ee77dcd1aeaa35fb0278af41904c47985f57c42 100644
--- a/modules/chain/dap_chain_ledger.c
+++ b/modules/chain/dap_chain_ledger.c
@@ -3342,7 +3342,7 @@ dap_hash_fast_t *dap_chain_ledger_get_final_chain_tx_hash(dap_ledger_t *a_ledger
         HASH_VALUE(l_tx_hash, sizeof(*l_tx_hash), l_hash_value);
         HASH_FIND_BYHASHVALUE(hh, l_ledger_pvt->ledger_items, l_tx_hash, sizeof(*l_tx_hash), l_hash_value, l_item);
         if (l_item) {
-            int l_out_num = 0;
+            int l_out_num = -1;
             dap_chain_datum_tx_out_cond_get(l_item->tx, a_cond_type, &l_out_num);
             if (l_out_num != -1 && l_out_num < MAX_OUT_ITEMS) {
                 if (dap_hash_fast_is_blank(&l_item->cache_data.tx_hash_spent_fast[l_out_num]))