wtxmgr: ignore ErrBucketNotFound error upon locked outputs bucket deletion

This error would be seen when an old wallet that has yet to update is
performing the latest wtxmgr migration. It's possible for the locked
outputs bucket to not exist if outputs haven't been locked before, so we
should its deletion correctly.
This commit is contained in:
Wilmer Paulino 2021-02-15 14:40:34 -08:00
parent 415f37ff11
commit 690a12fa8b
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F

View file

@ -1543,7 +1543,8 @@ func deleteBuckets(ns walletdb.ReadWriteBucket) error {
str := "failed to delete unmined inputs bucket" str := "failed to delete unmined inputs bucket"
return storeError(ErrDatabase, str, err) return storeError(ErrDatabase, str, err)
} }
if err := ns.DeleteNestedBucket(bucketLockedOutputs); err != nil { err := ns.DeleteNestedBucket(bucketLockedOutputs)
if err != nil && err != walletdb.ErrBucketNotFound {
str := "failed to delete locked outputs bucket" str := "failed to delete locked outputs bucket"
return storeError(ErrDatabase, str, err) return storeError(ErrDatabase, str, err)
} }