From 4daddf5460480b2062d8d31754c34c9e4290331c Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Fri, 26 Apr 2024 13:31:56 -0400 Subject: [PATCH] Swallow txindex metadata error --- entries/utxo_operation.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/entries/utxo_operation.go b/entries/utxo_operation.go index b68f01c..c079fcd 100644 --- a/entries/utxo_operation.go +++ b/entries/utxo_operation.go @@ -422,22 +422,13 @@ func parseUtxoOperationBundle( } txIndexMetadata, err := consumer.ComputeTransactionMetadata(transaction, blockHashHex, params, transaction.TxnFeeNanos, uint64(jj), utxoOps) if err != nil { + // If we fail to compute txindex metadata, log the error and continue to the next transaction. + // We still append this txn to the transactionUpdates slice so that we can have it in the db. glog.Errorf("parseUtxoOperationBundle: Problem computing transaction metadata for "+ "entry %+v at block height %v: %v", entry, entry.BlockHeight, err) - // TODO: swallow error and continue. - return nil, - nil, - nil, - nil, - errors.Wrapf( - err, - "parseUtxoOperationBundle: Problem computing transaction metadata for "+ - "entry %+v at block height %v", - entry, - entry.BlockHeight, - ) + transactionUpdates = append(transactionUpdates, transactions[jj]) + continue } - metadata := txIndexMetadata.GetEncoderForTxType(transaction.TxnMeta.GetTxnType()) basicTransferMetadata := txIndexMetadata.BasicTransferTxindexMetadata basicTransferMetadata.UtxoOps = nil