graph/db: split HasNode into two methods
HasNode currently is very v1 specific since it returns a time.Time timestamp which is specific to V1 node announcements. However, it is mostly only used for the "exists" return value. So here we split it up into HasNode which just checks existence and HasV1Node which retains the same behavaiour as before.
This commit is contained in:
8 files changed
+100
-25
No files matched your search
+2
-2
@@ -746,7 +746,7 @@ func (r *rpcServer) addDeps(ctx context.Context, s *server,
|
||||
return info.NodeKey1Bytes, info.NodeKey2Bytes, nil
|
||||
},
|
||||
HasNode: func(nodePub route.Vertex) (bool, error) {
|
||||
_, exists, err := graph.HasNode(ctx, nodePub)
|
||||
exists, err := graph.HasNode(ctx, nodePub)
|
||||
|
||||
return exists, err
|
||||
},
|
||||
@@ -1822,7 +1822,7 @@ func (r *rpcServer) VerifyMessage(ctx context.Context,
|
||||
//
|
||||
// TODO(phlip9): Require valid nodes to have capital in active channels.
|
||||
graph := r.server.graphDB
|
||||
_, active, err := graph.HasNode(ctx, pub)
|
||||
active, err := graph.HasNode(ctx, pub)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to query graph: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user