From 72acefb89fa889cd10ef80c2647935512f313dda Mon Sep 17 00:00:00 2001 From: bfbd Date: Sat, 22 Jul 2017 17:30:30 +0800 Subject: [PATCH] Release 0.15 --- address/address.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/address/address.go b/address/address.go index d05e774..638f16e 100644 --- a/address/address.go +++ b/address/address.go @@ -183,8 +183,12 @@ func InputBrainWalletSecret(tip string) (secret string, salt string, err error) color.Yellow(tip) println("") - terminal.MakeRaw(int(os.Stdin.Fd())) + oldState, err := terminal.MakeRaw(int(os.Stdin.Fd())) + if err != nil { + return + } t := terminal.NewTerminal(os.Stdin, "") + defer terminal.Restore(int(os.Stdin.Fd()), oldState) // Secret print("Brain wallet secret:") @@ -294,14 +298,14 @@ func GenerateBrainWalletSeed(secret string, salt string) (seed []byte, err error secret1 := make([]byte, len(secret_bytes)) secret2 := make([]byte, len(secret_bytes)) - for i, v := range secret { + for i, v := range secret_bytes { secret1[i] = byte(v | 0x01) secret2[i] = byte(v | 0x02) } salt1 := make([]byte, len(salt_bytes)) salt2 := make([]byte, len(salt_bytes)) - for i, v := range salt { + for i, v := range salt_bytes { salt1[i] = byte(v | 0x01) salt2[i] = byte(v | 0x02) }