lncli: Fix "invalid handle" error

Uses syscall.Stdin rather than 0 for terminal.ReadPassword() calls.
This commit is contained in:
Daniel Coonce 2017-12-18 16:04:04 -06:00 committed by Johan T. Halseth
parent e0c292d960
commit c36b1c3992

@ -12,6 +12,7 @@ import (
"os/exec" "os/exec"
"strconv" "strconv"
"strings" "strings"
"syscall"
"github.com/awalterschulze/gographviz" "github.com/awalterschulze/gographviz"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
@ -745,14 +746,14 @@ func create(ctx *cli.Context) error {
defer cleanUp() defer cleanUp()
fmt.Printf("Input wallet password: ") fmt.Printf("Input wallet password: ")
pw1, err := terminal.ReadPassword(0) pw1, err := terminal.ReadPassword(int(syscall.Stdin))
if err != nil { if err != nil {
return err return err
} }
fmt.Println() fmt.Println()
fmt.Printf("Confirm wallet password: ") fmt.Printf("Confirm wallet password: ")
pw2, err := terminal.ReadPassword(0) pw2, err := terminal.ReadPassword(int(syscall.Stdin))
if err != nil { if err != nil {
return err return err
} }
@ -785,7 +786,7 @@ func unlock(ctx *cli.Context) error {
defer cleanUp() defer cleanUp()
fmt.Printf("Input wallet password: ") fmt.Printf("Input wallet password: ")
pw, err := terminal.ReadPassword(0) pw, err := terminal.ReadPassword(int(syscall.Stdin))
if err != nil { if err != nil {
return err return err
} }