From 0bf26457386de8b3276c9187853eddb19f1e09b5 Mon Sep 17 00:00:00 2001 From: dabasov Date: Fri, 4 Aug 2023 00:08:16 +0300 Subject: [PATCH] cleaned up transaction logic --- code/go/0chain.net/blobbercore/datastore/postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/go/0chain.net/blobbercore/datastore/postgres.go b/code/go/0chain.net/blobbercore/datastore/postgres.go index 6c7f30232..48668c404 100644 --- a/code/go/0chain.net/blobbercore/datastore/postgres.go +++ b/code/go/0chain.net/blobbercore/datastore/postgres.go @@ -109,7 +109,7 @@ func (store *postgresStore) WithNewTransaction(f func(ctx context.Context) error tx := store.GetTransaction(ctx) err := f(ctx) - if err == nil { + if err != nil { tx.Rollback() return err }