@@ -192,10 +192,10 @@ func main() {
192192
193193// getClient establishes a SwapClient RPC connection and returns the client and
194194// a cleanup handler.
195- func getClient (ctx context. Context , cmd * cli.Command ) (looprpc.SwapClientClient ,
195+ func getClient (cmd * cli.Command ) (looprpc.SwapClientClient ,
196196 func (), error ) {
197197
198- client , _ , cleanup , err := getClientWithConn (ctx , cmd )
198+ client , _ , cleanup , err := getClientWithConn (cmd )
199199 if err != nil {
200200 return nil , nil , err
201201 }
@@ -205,15 +205,15 @@ func getClient(ctx context.Context, cmd *cli.Command) (looprpc.SwapClientClient,
205205
206206// getClientWithConn returns both the SwapClient RPC client and the underlying
207207// gRPC connection so callers can perform connection-aware actions.
208- func getClientWithConn (ctx context. Context , cmd * cli.Command ) (
209- looprpc. SwapClientClient , * grpc.ClientConn , func (), error ) {
208+ func getClientWithConn (cmd * cli.Command ) (looprpc. SwapClientClient ,
209+ * grpc.ClientConn , func (), error ) {
210210
211211 rpcServer := cmd .String ("rpcserver" )
212212 tlsCertPath , macaroonPath , err := extractPathArgs (cmd )
213213 if err != nil {
214214 return nil , nil , nil , err
215215 }
216- conn , err := getClientConn (ctx , rpcServer , tlsCertPath , macaroonPath )
216+ conn , err := getClientConn (rpcServer , tlsCertPath , macaroonPath )
217217 if err != nil {
218218 return nil , nil , nil , err
219219 }
@@ -432,7 +432,7 @@ func logSwap(swap *looprpc.SwapStatus) {
432432 fmt .Println ()
433433}
434434
435- func getClientConn (ctx context. Context , address , tlsCertPath , macaroonPath string ) (* grpc.ClientConn ,
435+ func getClientConn (address , tlsCertPath , macaroonPath string ) (* grpc.ClientConn ,
436436 error ) {
437437
438438 // We always need to send a macaroon.
@@ -446,17 +446,17 @@ func getClientConn(ctx context.Context, address, tlsCertPath, macaroonPath strin
446446 macOption ,
447447 }
448448
449- // TLS cannot be disabled, we'll always have a cert file to read.
449+ // Since TLS cannot be disabled, we'll always have a cert file to read.
450450 creds , err := credentials .NewClientTLSFromFile (tlsCertPath , "" )
451451 if err != nil {
452452 return nil , err
453453 }
454454
455455 opts = append (opts , grpc .WithTransportCredentials (creds ))
456456
457- conn , err := grpc .DialContext ( ctx , address , opts ... )
457+ conn , err := grpc .NewClient ( address , opts ... )
458458 if err != nil {
459- return nil , fmt .Errorf ("unable to connect to RPC server : %v" ,
459+ return nil , fmt .Errorf ("unable to create RPC client : %v" ,
460460 err )
461461 }
462462
0 commit comments