channeldb: add ErrEdgeAlreadyExist error
This commit is contained in:
parent
c3b2854428
commit
7a9a52c7b9
@ -69,7 +69,11 @@ var (
|
|||||||
|
|
||||||
// ErrEdgeNotFound is returned when an edge for the target chanID
|
// ErrEdgeNotFound is returned when an edge for the target chanID
|
||||||
// can't be found.
|
// can't be found.
|
||||||
ErrEdgeNotFound = fmt.Errorf("edge for chanID not found")
|
ErrEdgeNotFound = fmt.Errorf("edge not found")
|
||||||
|
|
||||||
|
// ErrEdgeAlreadyExist is returned when edge with specific
|
||||||
|
// channel id can't be added because it already exist.
|
||||||
|
ErrEdgeAlreadyExist = fmt.Errorf("edge already exist")
|
||||||
|
|
||||||
// ErrNodeAliasNotFound is returned when alias for node can't be found.
|
// ErrNodeAliasNotFound is returned when alias for node can't be found.
|
||||||
ErrNodeAliasNotFound = fmt.Errorf("alias for node not found")
|
ErrNodeAliasNotFound = fmt.Errorf("alias for node not found")
|
||||||
|
@ -424,7 +424,7 @@ func (c *ChannelGraph) AddChannelEdge(edge *ChannelEdgeInfo) error {
|
|||||||
// created. If so, then we can exit early as this method is
|
// created. If so, then we can exit early as this method is
|
||||||
// meant to be idempotent.
|
// meant to be idempotent.
|
||||||
if edgeInfo := edgeIndex.Get(chanKey[:]); edgeInfo != nil {
|
if edgeInfo := edgeIndex.Get(chanKey[:]); edgeInfo != nil {
|
||||||
return nil
|
return ErrEdgeAlreadyExist
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the edge hasn't been created yet, then we'll first add it
|
// If the edge hasn't been created yet, then we'll first add it
|
||||||
|
Loading…
Reference in New Issue
Block a user