disconnect just takes pid
This commit is contained in:
parent
ef5bbde160
commit
a686809bf0
14
cli/net.go
14
cli/net.go
@ -265,7 +265,7 @@ var NetListen = &cli.Command{
|
|||||||
var NetDisconnect = &cli.Command{
|
var NetDisconnect = &cli.Command{
|
||||||
Name: "disconnect",
|
Name: "disconnect",
|
||||||
Usage: "Disconnect from a peer",
|
Usage: "Disconnect from a peer",
|
||||||
ArgsUsage: "[peerMultiaddr|minerActorAddress]",
|
ArgsUsage: "[peerID]",
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
api, closer, err := GetAPI(cctx)
|
api, closer, err := GetAPI(cctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -274,13 +274,11 @@ var NetDisconnect = &cli.Command{
|
|||||||
defer closer()
|
defer closer()
|
||||||
ctx := ReqContext(cctx)
|
ctx := ReqContext(cctx)
|
||||||
|
|
||||||
pis, err := AddrInfoFromArg(ctx, cctx)
|
ids := cctx.Args().Slice()
|
||||||
if err != nil {
|
for _, id := range ids {
|
||||||
return err
|
pid := peer.ID(id)
|
||||||
}
|
fmt.Printf("disconnect %s: ", pid.Pretty())
|
||||||
for _, pi := range pis {
|
err := api.NetDisconnect(ctx, pid)
|
||||||
fmt.Printf("disconnect %s: ", pi.ID.Pretty())
|
|
||||||
err := api.NetDisconnect(ctx, pi.ID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("failure")
|
fmt.Println("failure")
|
||||||
return err
|
return err
|
||||||
|
@ -1235,7 +1235,7 @@ NAME:
|
|||||||
lotus-miner net disconnect - Disconnect from a peer
|
lotus-miner net disconnect - Disconnect from a peer
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
lotus-miner net disconnect [command options] [peerMultiaddr|minerActorAddress]
|
lotus-miner net disconnect [command options] [peerID]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--help, -h show help (default: false)
|
--help, -h show help (default: false)
|
||||||
|
@ -2552,7 +2552,7 @@ NAME:
|
|||||||
lotus net disconnect - Disconnect from a peer
|
lotus net disconnect - Disconnect from a peer
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
lotus net disconnect [command options] [peerMultiaddr|minerActorAddress]
|
lotus net disconnect [command options] [peerID]
|
||||||
|
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
--help, -h show help (default: false)
|
--help, -h show help (default: false)
|
||||||
|
Loading…
Reference in New Issue
Block a user