channeldb/graph: don't create node bucket in DeleteChannelEdge

Instead return ErrGraphNodeNotFound directly. If the node bucket was
created it would be empty, and the call delChannelByEdge ->
fetchChanEdgePolicies -> fetchChanEdgePolicy ->
deserializeChanEdgePolicy -> fetchLightningNode would return this error
anyway.
This commit is contained in:
Johan T. Halseth 2018-12-04 11:20:38 +01:00
parent 351f4aab79
commit 9722323161
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -1083,9 +1083,10 @@ func (c *ChannelGraph) DeleteChannelEdge(chanPoint *wire.OutPoint) error {
if chanIndex == nil {
return ErrEdgeNotFound
}
nodes, err := tx.CreateBucketIfNotExists(nodeBucket)
if err != nil {
return err
nodes := tx.Bucket(nodeBucket)
if nodes == nil {
return ErrGraphNodeNotFound
}
return delChannelByEdge(