Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions entries/utxo_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ func bulkInsertUtxoOperationsEntry(entries []*lib.StateChangeEntry, db *bun.DB,
basicTransferMetadata := txIndexMetadata.BasicTransferTxindexMetadata
basicTransferMetadata.UtxoOps = nil

// For atomic transactions, we need to remove the UtxoOps from the metadata for each inner transaction.
if metadata != nil && metadata.GetEncoderType() == lib.EncoderTypeAtomicTxnsWrapperTxindexMetadata {
atomicTxnMetadata := metadata.(*lib.AtomicTxnsWrapperTxindexMetadata)
for _, innerTxnMetadata := range atomicTxnMetadata.InnerTxnsTransactionMetadata {
if innerTxnMetadata.BasicTransferTxindexMetadata == nil {
continue
}
innerTxnMetadata.BasicTransferTxindexMetadata.UtxoOps = nil
}
}
transactions[jj].TxIndexMetadata = metadata

transactions[jj].TxIndexBasicTransferMetadata = txIndexMetadata.GetEncoderForTxType(lib.TxnTypeBasicTransfer)
Expand Down