(transactions []*model.Transaction)
| 1406 | } |
| 1407 | |
| 1408 | func collectQueuedCoalescingBalanceIDs(transactions []*model.Transaction) []string { |
| 1409 | seen := make(map[string]struct{}, len(transactions)*2) |
| 1410 | ids := make([]string, 0, len(transactions)*2) |
| 1411 | for _, txn := range transactions { |
| 1412 | if txn == nil { |
| 1413 | continue |
| 1414 | } |
| 1415 | for _, id := range []string{txn.Source, txn.Destination} { |
| 1416 | if id == "" { |
| 1417 | continue |
| 1418 | } |
| 1419 | if _, ok := seen[id]; ok { |
| 1420 | continue |
| 1421 | } |
| 1422 | seen[id] = struct{}{} |
| 1423 | ids = append(ids, id) |
| 1424 | } |
| 1425 | } |
| 1426 | sort.Strings(ids) |
| 1427 | return ids |
| 1428 | } |
| 1429 | |
| 1430 | func (l *LedgerForge) acquireBalanceSetLock(ctx context.Context, balanceIDs []string) (*redlock.MultiLocker, error) { |
| 1431 | ctx, span := tracer.Start(ctx, "Acquiring Balance Set Lock") |
no outgoing calls
no test coverage detected