diff options
Diffstat (limited to 'ethcrypto')
-rw-r--r-- | ethcrypto/crypto.go | 2 | ||||
-rw-r--r-- | ethcrypto/mnemonic.go | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ethcrypto/crypto.go b/ethcrypto/crypto.go index b4bb881a0..19f8c9e55 100644 --- a/ethcrypto/crypto.go +++ b/ethcrypto/crypto.go @@ -2,9 +2,9 @@ package ethcrypto import ( "code.google.com/p/go.crypto/ripemd160" + "code.google.com/p/go.crypto/sha3" "crypto/sha256" "github.com/ethereum/eth-go/ethutil" - "github.com/obscuren/sha3" ) func Sha256Bin(data []byte) []byte { diff --git a/ethcrypto/mnemonic.go b/ethcrypto/mnemonic.go index 6134f85f7..725846792 100644 --- a/ethcrypto/mnemonic.go +++ b/ethcrypto/mnemonic.go @@ -3,7 +3,9 @@ package ethcrypto import ( "fmt" "io/ioutil" + "os" "path" + "path/filepath" "runtime" "strconv" "strings" @@ -12,6 +14,14 @@ import ( func InitWords() []string { _, thisfile, _, _ := runtime.Caller(1) filename := path.Join(path.Dir(thisfile), "mnemonic.words.lst") + if _, err := os.Stat(filename); os.IsNotExist(err) { + fmt.Printf("reading mnemonic word list file 'mnemonic.words.lst' from source folder failed, looking in current folder.") + dir, err := filepath.Abs(filepath.Dir(os.Args[0])) + if err != nil { + panic(fmt.Errorf("problem getting current folder: ", err)) + } + filename = path.Join(dir, "mnemonic.words.lst") + } content, err := ioutil.ReadFile(filename) if err != nil { panic(fmt.Errorf("reading mnemonic word list file 'mnemonic.words.lst' failed: ", err)) |