graph/db: introduce VersionedGraph
For now, all instances will use V1 only so as not to change behaviour yet.
This commit is contained in:
9 files changed
+122
-84
No files matched your search
+4
-4
@@ -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 := s.v1Graph.HasNode(ctx, nodePub)
|
||||
|
||||
return exists, err
|
||||
},
|
||||
@@ -1821,7 +1821,7 @@ func (r *rpcServer) VerifyMessage(ctx context.Context,
|
||||
// channels signed the message.
|
||||
//
|
||||
// TODO(phlip9): Require valid nodes to have capital in active channels.
|
||||
graph := r.server.graphDB
|
||||
graph := r.server.v1Graph
|
||||
active, err := graph.HasNode(ctx, pub)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to query graph: %w", err)
|
||||
@@ -7143,7 +7143,7 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
|
||||
"include_channels")
|
||||
}
|
||||
|
||||
graph := r.server.graphDB
|
||||
graph := r.server.v1Graph
|
||||
|
||||
// First, parse the hex-encoded public key into a full in-memory public
|
||||
// key object we can work with for querying.
|
||||
@@ -8298,7 +8298,7 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
|
||||
return "", err
|
||||
}
|
||||
|
||||
peer, err := r.server.graphDB.FetchNode(ctx, vertex)
|
||||
peer, err := r.server.v1Graph.FetchNode(ctx, vertex)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user