Skip to content

Commit cb3eb27

Browse files
Simplify vault
Signed-off-by: Alexandros Filios <alexandros.filios@ibm.com>
1 parent da9f9b1 commit cb3eb27

File tree

1 file changed

+2
-18
lines changed
  • platform/common/core/generic/vault

1 file changed

+2
-18
lines changed

platform/common/core/generic/vault/vault.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,24 +201,8 @@ func (db *Vault[V]) unmapInterceptors(txIDs ...driver.TxID) (map[driver.TxID]TxI
201201

202202
result, notFound := collections.SubMap(db.Interceptors, txIDs...)
203203

204-
vcs, err := db.txIDStore.Iterator(&driver.SeekSet{TxIDs: notFound})
205-
if err != nil {
206-
return nil, errors.Wrapf(err, "read-write set for txids [%v] could not be found", txIDs)
207-
}
208-
209-
foundInStore := collections.NewSet[driver.TxID]()
210-
for vc, err := vcs.Next(); vc != nil; vc, err = vcs.Next() {
211-
if err != nil {
212-
return nil, errors.Wrapf(err, "read-write set for txid %s could not be found", vc.TxID)
213-
}
214-
if vc.Code == db.vcProvider.Unknown() {
215-
return nil, errors.Errorf("read-write set for txid %s could not be found", vc.TxID)
216-
}
217-
foundInStore.Add(vc.TxID)
218-
}
219-
220-
if unknownTxIDs := collections.NewSet(notFound...).Minus(foundInStore); !unknownTxIDs.Empty() {
221-
return nil, errors.Errorf("read-write set for txid %s could not be found", unknownTxIDs.ToSlice()[0])
204+
if len(notFound) > 0 {
205+
return nil, errors.Errorf("read-write set for txids [%v] could not be found", notFound)
222206
}
223207

224208
for txID, i := range result {

0 commit comments

Comments
 (0)