MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / handleSplitTransactions

Method handleSplitTransactions

transaction.go:1886–1895  ·  view source on GitHub ↗

handleSplitTransactions attempts to split a transaction into multiple transactions if needed. It starts a tracing span, attempts to split the transaction, and validates the result. Parameters: - ctx context.Context: The context for the operation. - transaction *model.Transaction: The transaction to

(ctx context.Context, transaction *model.Transaction)

Source from the content-addressed store, hash-verified

1884// - []*model.Transaction: A slice of split transactions, or empty if no split is needed.
1885// - error: An error if the transaction splitting fails.
1886func (l *LedgerForge) handleSplitTransactions(ctx context.Context, transaction *model.Transaction) ([]*model.Transaction, error) {
1887 ctx, span := tracer.Start(ctx, "HandleSplitTransactions")
1888 defer span.End()
1889
1890 transactions, err := transaction.SplitTransactionPrecise(ctx)
1891 if err != nil {
1892 return nil, fmt.Errorf("failed to split transaction: %w", err)
1893 }
1894 return transactions, nil
1895}
1896
1897// processTxns handles the processing of transactions based on whether they are split or single.
1898// It delegates to the appropriate processing function based on the presence of split transactions.

Callers 1

QueueTransactionMethod · 0.95

Calls 2

StartMethod · 0.45

Tested by

no test coverage detected