MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / enqueueTransactions

Function enqueueTransactions

transaction.go:2098–2113  ·  view source on GitHub ↗

enqueueTransactions enqueues the original transaction or its split transactions into the provided queue. It starts by determining which transactions to enqueue, then iterates through them and enqueues each one. If an error occurs during enqueuing, it logs the error and sends a notification. Paramet

(ctx context.Context, queue *Queue, originalTransaction *model.Transaction, splitTransactions []*model.Transaction)

Source from the content-addressed store, hash-verified

2096// Returns:
2097// - error: An error if any of the transactions could not be enqueued.
2098func enqueueTransactions(ctx context.Context, queue *Queue, originalTransaction *model.Transaction, splitTransactions []*model.Transaction) error {
2099 transactionsToEnqueue := splitTransactions
2100 if len(transactionsToEnqueue) == 0 {
2101 transactionsToEnqueue = []*model.Transaction{originalTransaction}
2102 }
2103
2104 for _, txn := range transactionsToEnqueue {
2105 if err := queue.Enqueue(ctx, txn); err != nil {
2106 notification.NotifyError(err)
2107 logrus.WithError(err).Error("failed to queue transaction")
2108 return err
2109 }
2110 }
2111
2112 return nil
2113}
2114
2115// GetTransaction retrieves a transaction by its ID from the datasource.
2116// It starts a tracing span, fetches the transaction, and records relevant events and errors.

Callers 2

finalizeCommitmentMethod · 0.85
processTransactionAsyncFunction · 0.85

Calls 3

NotifyErrorFunction · 0.92
EnqueueMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected