From 980bed1c3cb1f0f29fba70548664f12dc7321bbb Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 9 Jul 2019 14:25:33 +0200 Subject: [PATCH] Fix remaining License: MIT Signed-off-by: Jakub Sztandera --- cli/net.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cli/net.go b/cli/net.go index e98273de8..199ce147c 100644 --- a/cli/net.go +++ b/cli/net.go @@ -27,7 +27,8 @@ var netPeers = &cli.Command{ Usage: "Print peers", Action: func(cctx *cli.Context) error { api := getApi(cctx) - fmt.Println(api.NetPeers(reqContext(cctx))) + ctx := reqContext(cctx) + fmt.Println(api.NetPeers(ctx)) return nil }, @@ -38,7 +39,8 @@ var netListen = &cli.Command{ Usage: "List listen addresses", Action: func(cctx *cli.Context) error { api := getApi(cctx) - fmt.Println(api.NetAddrsListen(reqContext(cctx))) + ctx := reqContext(cctx) + fmt.Println(api.NetAddrsListen(ctx)) return nil }, @@ -48,8 +50,8 @@ var netConnect = &cli.Command{ Name: "connect", Usage: "Connect to a peer", Action: func(cctx *cli.Context) error { - ctx := reqContext(cctx) api := getApi(cctx) + ctx := reqContext(cctx) pis, err := parseAddresses(ctx, cctx.Args().Slice()) if err != nil { @@ -58,7 +60,7 @@ var netConnect = &cli.Command{ for _, pi := range pis { fmt.Printf("connect %s: ", pi.ID.Pretty()) - err := api.NetConnect(context.Background(), pi) + err := api.NetConnect(ctx, pi) if err != nil { fmt.Println("failure") return err