Skip to content

Commit 7cf5b5b

Browse files
committed
graph: remove unused ForEachNode method from Builder
And from various interfaces where it is not needed.
1 parent ce8cde6 commit 7cf5b5b

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

graph/builder.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,18 +1555,6 @@ func (b *Builder) FetchLightningNode(
15551555
return b.cfg.Graph.FetchLightningNode(node)
15561556
}
15571557

1558-
// ForEachNode is used to iterate over every node in router topology.
1559-
//
1560-
// NOTE: This method is part of the ChannelGraphSource interface.
1561-
func (b *Builder) ForEachNode(
1562-
cb func(*models.LightningNode) error) error {
1563-
1564-
return b.cfg.Graph.ForEachNode(
1565-
func(_ kvdb.RTx, n *models.LightningNode) error {
1566-
return cb(n)
1567-
})
1568-
}
1569-
15701558
// ForAllOutgoingChannels is used to iterate over all outgoing channels owned by
15711559
// the router.
15721560
//

graph/interfaces.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ type ChannelGraphSource interface {
8585
// public key. channeldb.ErrGraphNodeNotFound is returned if the node
8686
// doesn't exist within the graph.
8787
FetchLightningNode(route.Vertex) (*models.LightningNode, error)
88-
89-
// ForEachNode is used to iterate over every node in the known graph.
90-
ForEachNode(func(node *models.LightningNode) error) error
9188
}
9289

9390
// DB is an interface describing a persisted Lightning Network graph.
@@ -241,12 +238,6 @@ type DB interface {
241238
FetchLightningNode(nodePub route.Vertex) (*models.LightningNode,
242239
error)
243240

244-
// ForEachNode iterates through all the stored vertices/nodes in the
245-
// graph, executing the passed callback with each node encountered. If
246-
// the callback returns an error, then the transaction is aborted and
247-
// the iteration stops early.
248-
ForEachNode(cb func(kvdb.RTx, *models.LightningNode) error) error
249-
250241
// ForEachNodeChannel iterates through all channels of the given node,
251242
// executing the passed callback with an edge info structure and the
252243
// policies of each end of the channel. The first edge policy is the

0 commit comments

Comments
 (0)