diff --git a/graph/db/kv_store.go b/graph/db/kv_store.go index 87651e461..f6607623c 100644 --- a/graph/db/kv_store.go +++ b/graph/db/kv_store.go @@ -658,7 +658,7 @@ func (c *KVStore) ForEachNodeCached(cb func(node route.Vertex, // We'll iterate over each node, then the set of channels for each // node, and construct a similar callback functiopn signature as the // main funcotin expects. - return c.forEachNode(func(tx kvdb.RTx, + return forEachNode(c.db, func(tx kvdb.RTx, node *models.LightningNode) error { channels := make(map[uint64]*DirectedChannel) @@ -774,7 +774,7 @@ func (c *KVStore) DisabledChannelIDs() ([]uint64, error) { // executed under the same read transaction and so, methods on the NodeTx object // _MUST_ only be called from within the call-back. func (c *KVStore) ForEachNode(cb func(tx NodeRTx) error) error { - return c.forEachNode(func(tx kvdb.RTx, + return forEachNode(c.db, func(tx kvdb.RTx, node *models.LightningNode) error { return cb(newChanGraphNodeTx(tx, c, node)) @@ -788,7 +788,7 @@ func (c *KVStore) ForEachNode(cb func(tx NodeRTx) error) error { // // TODO(roasbeef): add iterator interface to allow for memory efficient graph // traversal when graph gets mega. -func (c *KVStore) forEachNode( +func forEachNode(db kvdb.Backend, cb func(kvdb.RTx, *models.LightningNode) error) error { traversal := func(tx kvdb.RTx) error { @@ -819,7 +819,7 @@ func (c *KVStore) forEachNode( }) } - return kvdb.View(c.db, traversal, func() {}) + return kvdb.View(db, traversal, func() {}) } // ForEachNodeCacheable iterates through all the stored vertices/nodes in the