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:
parent
351f4aab79
commit
9722323161
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user