channeldb/graph: don't create bucket in delEdgeUpdateIndexEntry

We are deleting what's in the bucket, so if it doesn't exist, just
return early with a non-error.
This commit is contained in:
Johan T. Halseth 2018-12-04 11:20:38 +01:00
parent 84de318553
commit 86d40636cd
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -1528,11 +1528,10 @@ func delEdgeUpdateIndexEntry(edgesBucket *bbolt.Bucket, chanID uint64,
// First, we'll fetch the edge update index bucket which currently
// stores an entry for the channel we're about to delete.
updateIndex, err := edgesBucket.CreateBucketIfNotExists(
edgeUpdateIndexBucket,
)
if err != nil {
return err
updateIndex := edgesBucket.Bucket(edgeUpdateIndexBucket)
if updateIndex == nil {
// No edges in bucket, return early.
return nil
}
// Now that we have the bucket, we'll attempt to construct a template