diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-14 20:04:43 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-14 20:04:43 +0800 |
commit | c9db87277be495b3567b2831f2f88b8192edb20f (patch) | |
tree | 3cd3abb22e998fe4ffaf3d3dd3e5571c422d5d69 /utils/cmd.go | |
parent | 2c7b625daaf062192db2fa604344f79c1bdbb232 (diff) | |
parent | f18ec51cb3959cc662bfc7b84314cd1d3b1541b5 (diff) | |
download | go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar.gz go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar.bz2 go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar.lz go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar.xz go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.tar.zst go-tangerine-c9db87277be495b3567b2831f2f88b8192edb20f.zip |
Fix merge conflicts
Diffstat (limited to 'utils/cmd.go')
-rw-r--r-- | utils/cmd.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/utils/cmd.go b/utils/cmd.go index 66cfbeff9..8395ac8fc 100644 --- a/utils/cmd.go +++ b/utils/cmd.go @@ -1,9 +1,7 @@ package utils import ( - "encoding/hex" "github.com/ethereum/eth-go" - "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethminer" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethrpc" @@ -26,15 +24,12 @@ func DoMining(ethereum *eth.Ethereum) { // Set Mining status ethereum.Mining = true - data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) - if len(data) == 0 { + if ethutil.GetKeyRing().Len() == 0 { log.Println("No address found, can't start mining") return } - - keyRing := ethutil.NewValueFromBytes(data) - addr := keyRing.Get(0).Bytes() - pair, _ := ethchain.NewKeyPairFromSec(ethutil.FromHex(hex.EncodeToString(addr))) + keyPair := ethutil.GetKeyRing().Get(0) + addr := keyPair.Address() go func() { // Give it some time to connect with peers @@ -45,7 +40,7 @@ func DoMining(ethereum *eth.Ethereum) { } log.Println("Miner started") - miner := ethminer.NewDefaultMiner(pair.Address(), ethereum) + miner := ethminer.NewDefaultMiner(addr, ethereum) miner.Start() }() } |