Skip to content

Commit 2c59089

Browse files
Updated AddTransaction
1 parent 18ea894 commit 2c59089

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

internal/session/interact.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,10 @@ func (m *Manager) AddTransaction(session *Session, txn *types.Transaction) error
174174
/* push transaction into the queue from back */
175175
session.TransactionQueue.PushBack(txn)
176176

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

189182
return nil
190183
}

0 commit comments

Comments
 (0)