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

Method rollbackBatchTransactions

transaction.go:2404–2416  ·  view source on GitHub ↗

rollbackBatchTransactions performs a rollback of transactions in a batch Returns the action performed (voided/refunded) and any error that occurred

(ctx context.Context, batchID string, isInflight bool)

Source from the content-addressed store, hash-verified

2402// rollbackBatchTransactions performs a rollback of transactions in a batch
2403// Returns the action performed (voided/refunded) and any error that occurred
2404func (l *LedgerForge) rollbackBatchTransactions(ctx context.Context, batchID string, isInflight bool) (string, error) {
2405 var action string
2406 var rollbackErr error
2407
2408 if isInflight {
2409 action, rollbackErr = l.voidInflightBatchTransactions(ctx, batchID)
2410 } else {
2411 action, rollbackErr = l.refundNonInflightBatchTransactions(ctx, batchID)
2412 }
2413
2414 l.logRollbackResult(batchID, action, rollbackErr)
2415 return action, rollbackErr
2416}
2417
2418// voidInflightBatchTransactions voids all inflight transactions in a batch
2419func (l *LedgerForge) voidInflightBatchTransactions(ctx context.Context, batchID string) (string, error) {

Callers 2

Tested by

no test coverage detected