Skip to content

Commit 7a1b548

Browse files
committed
graph/db: rename DeleteLightningNode
to DeleteNode
1 parent cd3bd05 commit 7a1b548

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

graph/db/graph.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,12 @@ func (c *ChannelGraph) AddNode(ctx context.Context,
295295
return nil
296296
}
297297

298-
// DeleteLightningNode starts a new database transaction to remove a vertex/node
298+
// DeleteNode starts a new database transaction to remove a vertex/node
299299
// from the database according to the node's public key.
300-
func (c *ChannelGraph) DeleteLightningNode(ctx context.Context,
300+
func (c *ChannelGraph) DeleteNode(ctx context.Context,
301301
nodePub route.Vertex) error {
302302

303-
err := c.V1Store.DeleteLightningNode(ctx, nodePub)
303+
err := c.V1Store.DeleteNode(ctx, nodePub)
304304
if err != nil {
305305
return err
306306
}

graph/db/graph_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
151151

152152
// Next, delete the node from the graph, this should purge all data
153153
// related to the node.
154-
require.NoError(t, graph.DeleteLightningNode(ctx, testPub))
154+
require.NoError(t, graph.DeleteNode(ctx, testPub))
155155
assertNodeNotInCache(t, graph, testPub)
156156

157157
// Attempting to delete the node again should return an error since
158158
// the node is no longer known.
159159
require.ErrorIs(
160-
t, graph.DeleteLightningNode(ctx, testPub),
160+
t, graph.DeleteNode(ctx, testPub),
161161
ErrGraphNodeNotFound,
162162
)
163163

@@ -331,7 +331,7 @@ func TestPartialNode(t *testing.T) {
331331

332332
// Next, delete the node from the graph, this should purge all data
333333
// related to the node.
334-
require.NoError(t, graph.DeleteLightningNode(ctx, pubKey1))
334+
require.NoError(t, graph.DeleteNode(ctx, pubKey1))
335335
assertNodeNotInCache(t, graph, testPub)
336336

337337
// Finally, attempt to fetch the node again. This should fail as the
@@ -3520,7 +3520,7 @@ func TestNodePruningUpdateIndexDeletion(t *testing.T) {
35203520

35213521
// We'll now delete the node from the graph, this should result in it
35223522
// being removed from the update index as well.
3523-
err = graph.DeleteLightningNode(ctx, node1.PubKeyBytes)
3523+
err = graph.DeleteNode(ctx, node1.PubKeyBytes)
35243524
require.NoError(t, err)
35253525

35263526
// Now that the node has been deleted, we'll again query the nodes in

graph/db/interfaces.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ type V1Store interface { //nolint:interfacebloat
101101
// node.
102102
LookupAlias(ctx context.Context, pub *btcec.PublicKey) (string, error)
103103

104-
// DeleteLightningNode starts a new database transaction to remove a
104+
// DeleteNode starts a new database transaction to remove a
105105
// vertex/node from the database according to the node's public key.
106-
DeleteLightningNode(ctx context.Context, nodePub route.Vertex) error
106+
DeleteNode(ctx context.Context, nodePub route.Vertex) error
107107

108108
// NodeUpdatesInHorizon returns all the known lightning node which have
109109
// an update timestamp within the passed range. This method can be used

graph/db/kv_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,9 @@ func (c *KVStore) LookupAlias(_ context.Context,
10611061
return alias, nil
10621062
}
10631063

1064-
// DeleteLightningNode starts a new database transaction to remove a vertex/node
1064+
// DeleteNode starts a new database transaction to remove a vertex/node
10651065
// from the database according to the node's public key.
1066-
func (c *KVStore) DeleteLightningNode(_ context.Context,
1066+
func (c *KVStore) DeleteNode(_ context.Context,
10671067
nodePub route.Vertex) error {
10681068

10691069
// TODO(roasbeef): ensure dangling edges are removed...

graph/db/sql_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ func (s *SQLStore) AddrsForNode(ctx context.Context,
369369
return known, addresses, nil
370370
}
371371

372-
// DeleteLightningNode starts a new database transaction to remove a vertex/node
372+
// DeleteNode starts a new database transaction to remove a vertex/node
373373
// from the database according to the node's public key.
374374
//
375375
// NOTE: part of the V1Store interface.
376-
func (s *SQLStore) DeleteLightningNode(ctx context.Context,
376+
func (s *SQLStore) DeleteNode(ctx context.Context,
377377
pubKey route.Vertex) error {
378378

379379
err := s.db.ExecTx(ctx, sqldb.WriteTxOpt(), func(db SQLQueries) error {

0 commit comments

Comments
 (0)