-/*
-Retreives the transaction table entry for the given request.
-Returns error in case the transaction cannot be found.
-*/
-func (t *Tracker) Update_transaction(SubID uint16, trans_type Action, xact Transaction) error{
- key := Transaction_key{SubID, trans_type}
- if _, ok := t.transaction_table[key]; ok {
- // TODO: Implement merge related check here. If the key is same but the value is different.
- err := fmt.Errorf("Transaction tracker: Similar transaction with sub id %d and type %s is ongoing", key.SubID, key.trans_type )
- return err
+ t.mutex.Lock()
+ defer t.mutex.Unlock()
+
+ xappkey := TransactionXappKey{endpoint, params.Xid}
+ if _, ok := t.transactionXappTable[xappkey]; ok {
+ err := fmt.Errorf("Tracker: Similar transaction with xappkey %s is ongoing, transaction %s not created ", xappkey, trans)
+ return nil, err