From 690a12fa8b47e1e24f4e30dff7fde54b04b0b1ca Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 15 Feb 2021 14:40:34 -0800 Subject: [PATCH] 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. --- wtxmgr/db.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wtxmgr/db.go b/wtxmgr/db.go index 7c7d969..60221ba 100644 --- a/wtxmgr/db.go +++ b/wtxmgr/db.go @@ -1543,7 +1543,8 @@ func deleteBuckets(ns walletdb.ReadWriteBucket) error { str := "failed to delete unmined inputs bucket" 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" return storeError(ErrDatabase, str, err) }