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 }