disconnect just takes pid

This commit is contained in:
zenground0 2022-07-01 12:31:38 -05:00
parent ef5bbde160
commit a686809bf0
3 changed files with 8 additions and 10 deletions

View File

@ -265,7 +265,7 @@ var NetListen = &cli.Command{
var NetDisconnect = &cli.Command{
Name: "disconnect",
Usage: "Disconnect from a peer",
ArgsUsage: "[peerMultiaddr|minerActorAddress]",
ArgsUsage: "[peerID]",
Action: func(cctx *cli.Context) error {
api, closer, err := GetAPI(cctx)
if err != nil {
@ -274,13 +274,11 @@ var NetDisconnect = &cli.Command{
defer closer()
ctx := ReqContext(cctx)
pis, err := AddrInfoFromArg(ctx, cctx)
if err != nil {
return err
}
for _, pi := range pis {
fmt.Printf("disconnect %s: ", pi.ID.Pretty())
err := api.NetDisconnect(ctx, pi.ID)
ids := cctx.Args().Slice()
for _, id := range ids {
pid := peer.ID(id)
fmt.Printf("disconnect %s: ", pid.Pretty())
err := api.NetDisconnect(ctx, pid)
if err != nil {
fmt.Println("failure")
return err

View File

@ -1235,7 +1235,7 @@ NAME:
lotus-miner net disconnect - Disconnect from a peer
USAGE:
lotus-miner net disconnect [command options] [peerMultiaddr|minerActorAddress]
lotus-miner net disconnect [command options] [peerID]
OPTIONS:
--help, -h show help (default: false)

View File

@ -2552,7 +2552,7 @@ NAME:
lotus net disconnect - Disconnect from a peer
USAGE:
lotus net disconnect [command options] [peerMultiaddr|minerActorAddress]
lotus net disconnect [command options] [peerID]
OPTIONS:
--help, -h show help (default: false)