Skip to content

Commit 0697a1e

Browse files
committed
Swallow txindex metadata error
1 parent 3154c4d commit 0697a1e

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

entries/utxo_operation.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -422,22 +422,13 @@ func parseUtxoOperationBundle(
422422
}
423423
txIndexMetadata, err := consumer.ComputeTransactionMetadata(transaction, blockHashHex, params, transaction.TxnFeeNanos, uint64(jj), utxoOps)
424424
if err != nil {
425+
// If we fail to compute txindex metadata, log the error and continue to the next transaction.
426+
// We still append this txn to the transactionUpdates slice so that we can have it in the db.
425427
glog.Errorf("parseUtxoOperationBundle: Problem computing transaction metadata for "+
426428
"entry %+v at block height %v: %v", entry, entry.BlockHeight, err)
427-
// TODO: swallow error and continue.
428-
return nil,
429-
nil,
430-
nil,
431-
nil,
432-
errors.Wrapf(
433-
err,
434-
"parseUtxoOperationBundle: Problem computing transaction metadata for "+
435-
"entry %+v at block height %v",
436-
entry,
437-
entry.BlockHeight,
438-
)
429+
transactionUpdates = append(transactionUpdates, transactions[jj])
430+
continue
439431
}
440-
441432
metadata := txIndexMetadata.GetEncoderForTxType(transaction.TxnMeta.GetTxnType())
442433
basicTransferMetadata := txIndexMetadata.BasicTransferTxindexMetadata
443434
basicTransferMetadata.UtxoOps = nil

0 commit comments

Comments
 (0)