Skip to content

Commit 3d3c597

Browse files
Updated for transaction structure
1 parent 3f83815 commit 3d3c597

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

internal/session/interact.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,21 @@ func (m *Manager) ExpireSession(username string) error {
170170
}
171171

172172
/* add transaction to a session - assumes caller holds necessary locks */
173-
func (m *Manager) AddTransaction(session *Session, txn interface{}) error {
173+
func (m *Manager) AddTransaction(session *Session, txn types.Transaction) error {
174174
/* push transaction into the queue from back */
175175
session.TransactionQueue.PushBack(txn)
176176

177177
/* convert transaction to correct type and save to Redis */
178-
if tx, ok := txn.(*types.Transaction); ok {
179-
if err := m.saveTransactionResultsRedis(session, *tx); err != nil {
178+
// if tx, ok := txn.(*types.Transaction); ok {
179+
180+
// *tx was used here
181+
if err := m.saveTransactionResultsRedis(session, txn); err != nil {
180182
return fmt.Errorf("failed to save transaction to Redis: %w", err)
181183
}
182-
} else {
183-
return fmt.Errorf("invalid transaction type: expected *types.Transaction")
184-
}
184+
185+
// } else {
186+
// return fmt.Errorf("invalid transaction type: expected *types.Transaction")
187+
// }
185188

186189
return nil
187190
}

0 commit comments

Comments
 (0)