From 70aeda15895811b9c4c1df1741efff51c8127471 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 4 Dec 2018 11:20:39 +0100 Subject: [PATCH] channeldb/graph: don't create node bucket in PruneGraph Instead return ErrSourceNodeNotSet directly. This would be returned from the call pruneGraphNodes -> sourceNode anyway. --- channeldb/graph.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/channeldb/graph.go b/channeldb/graph.go index 22efa93ae..849afd9f2 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -710,9 +710,9 @@ func (c *ChannelGraph) PruneGraph(spentOutputs []*wire.OutPoint, if err != nil { return err } - nodes, err := tx.CreateBucketIfNotExists(nodeBucket) - if err != nil { - return err + nodes := tx.Bucket(nodeBucket) + if nodes == nil { + return ErrSourceNodeNotSet } // For each of the outpoints that have been spent within the