mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
graph/db: let ForEachNodeCached take a context
This commit is contained in:
@@ -219,7 +219,7 @@ func (nc dbNodeCached) ForEachChannel(ctx context.Context,
|
||||
func (dc *databaseChannelGraphCached) ForEachNode(ctx context.Context,
|
||||
cb func(context.Context, Node) error) error {
|
||||
|
||||
return dc.db.ForEachNodeCached(func(n route.Vertex,
|
||||
return dc.db.ForEachNodeCached(ctx, func(n route.Vertex,
|
||||
channels map[uint64]*graphdb.DirectedChannel) error {
|
||||
|
||||
if len(channels) > 0 {
|
||||
|
@@ -234,6 +234,6 @@ type GraphSource interface {
|
||||
// channel graph cache if one is available. It is less consistent than
|
||||
// ForEachNode since any further calls are made across multiple
|
||||
// transactions.
|
||||
ForEachNodeCached(cb func(node route.Vertex,
|
||||
ForEachNodeCached(ctx context.Context, cb func(node route.Vertex,
|
||||
chans map[uint64]*graphdb.DirectedChannel) error) error
|
||||
}
|
||||
|
Reference in New Issue
Block a user