Rollback namespace transactions when bucket is not found.
This fixes a deadlock where failed transactions due to the namespaces' bucket being missing would cause deadlocks due to bolt's mmap rwmutex still being read or write locked (and no way to unlock it, since the underlying bolt tx was not returned on failure).
This commit is contained in:
parent
e12d23716f
commit
d2c851431b
1 changed files with 1 additions and 0 deletions
|
@ -290,6 +290,7 @@ func (ns *namespace) Begin(writable bool) (walletdb.Tx, error) {
|
|||
|
||||
bucket := boltTx.Bucket(ns.key)
|
||||
if bucket == nil {
|
||||
boltTx.Rollback()
|
||||
return nil, walletdb.ErrBucketNotFound
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue