提交 8f35e308 编写于 作者: M Maximilian Meister 提交者: Felix Lange

cmd/geth: fix geth attach --datadir=... (#15517)

上级 e323ed5a
......@@ -17,6 +17,7 @@
package main
import (
"fmt"
"os"
"os/signal"
"strings"
......@@ -112,7 +113,11 @@ func localConsole(ctx *cli.Context) error {
// console to it.
func remoteConsole(ctx *cli.Context) error {
// Attach to a remotely running geth instance and start the JavaScript console
client, err := dialRPC(ctx.Args().First())
endpoint := ctx.Args().First()
if endpoint == "" && ctx.GlobalIsSet(utils.DataDirFlag.Name) {
endpoint = fmt.Sprintf("%s/geth.ipc", ctx.GlobalString(utils.DataDirFlag.Name))
}
client, err := dialRPC(endpoint)
if err != nil {
utils.Fatalf("Unable to attach to remote geth: %v", err)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册