From e81689057afbd08b0748b7e874db1c9ab259394f Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 4 Oct 2017 19:35:10 -0700 Subject: [PATCH] discovery+routing: remove DeleteEdge from ChannelGraphSource interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit removes the recently added DeleteEdge method from the ChannelGraphSource interface as it’s no longer needed. --- discovery/gossiper_test.go | 5 ----- routing/router.go | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index 08c1c8a1..2f1ec8bc 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -135,11 +135,6 @@ func (r *mockGraphSource) AddEdge(info *channeldb.ChannelEdgeInfo) error { return nil } -func (r *mockGraphSource) DeleteEdge(info *channeldb.ChannelEdgeInfo) error { - delete(r.infos, info.ChannelID) - return nil -} - func (r *mockGraphSource) UpdateEdge(edge *channeldb.ChannelEdgePolicy) error { r.edges[edge.ChannelID] = append( r.edges[edge.ChannelID], diff --git a/routing/router.go b/routing/router.go index c2551ddf..e588b04a 100644 --- a/routing/router.go +++ b/routing/router.go @@ -39,9 +39,6 @@ type ChannelGraphSource interface { // edge/channel might be used in construction of payment path. AddEdge(edge *channeldb.ChannelEdgeInfo) error - // DeleteEdge is used to delete an edge from the router database. - DeleteEdge(edge *channeldb.ChannelEdgeInfo) error - // AddProof updates the channel edge info with proof which is needed to // properly announce the edge to the rest of the network. AddProof(chanID lnwire.ShortChannelID, proof *channeldb.ChannelAuthProof) error @@ -1297,13 +1294,6 @@ func (r *ChannelRouter) AddEdge(edge *channeldb.ChannelEdgeInfo) error { } } -// DeleteEdge is used to delete an edge from the router database. -// -// NOTE: This method is part of the ChannelGraphSource interface. -func (r *ChannelRouter) DeleteEdge(edge *channeldb.ChannelEdgeInfo) error { - return r.cfg.Graph.DeleteChannelEdge(&edge.ChannelPoint) -} - // UpdateEdge is used to update edge information, without this message edge // considered as not fully constructed. //