packages/net/v2raya/patches/018-fix-do-not-rollback-closed-transaction.patch
Tianling Shen 17362ce57c
v2raya: backports upstream fixes and add 3 new options
It may take a long time waiting for a new tag, so backport these
important bug fixes for now.

While at it, added 3 new options provided by upstream, and deprecated
the usage of `$(AUTORELEASE)`.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-11-29 02:38:47 +08:00

27 lines
601 B
Diff

From 451912074ba1ba4000c66874876bc0a6b64cb5da Mon Sep 17 00:00:00 2001
From: Kelo <meetkelo@outlook.com>
Date: Sun, 30 Oct 2022 16:49:22 +0800
Subject: [PATCH] fix: do not rollback closed transaction
---
service/db/boltdb.go | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/db/boltdb.go
+++ b/db/boltdb.go
@@ -56,14 +56,13 @@ func Transaction(db *bbolt.DB, fn func(*
if err != nil {
return err
}
- defer tx.Rollback()
dirty, err := fn(tx)
if err != nil {
_ = tx.Rollback()
return err
}
if !dirty {
- return nil
+ return tx.Rollback()
}
return tx.Commit()
}