diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 22117c6f7..ecb0dbf24 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -152,6 +152,10 @@ func connectPeer(ctx *cli.Context) error { targetAddress := ctx.Args().Get(0) splitAddr := strings.Split(targetAddress, "@") + if len(splitAddr) != 2 { + return fmt.Errorf("target address expected in format: lnid@host:port") + } + addr := &lnrpc.LightningAddress{ PubKeyHash: splitAddr[0], Host: splitAddr[1],