diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
commit | f18ec51cb3959cc662bfc7b84314cd1d3b1541b5 (patch) | |
tree | 1c3d99407624dc791db0cb6c135bd2bd1dfc56cf /utils/cmd.go | |
parent | e8147cf7c6f508910698e6743ad347c78010ffe3 (diff) | |
download | go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.gz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.bz2 go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.lz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.xz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.zst go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.zip |
Switched to new keyring methods
Diffstat (limited to 'utils/cmd.go')
-rw-r--r-- | utils/cmd.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/utils/cmd.go b/utils/cmd.go index a99fd9eed..654014169 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/ethrpc" "github.com/ethereum/eth-go/ethutil" @@ -18,13 +16,10 @@ func DoMining(ethereum *eth.Ethereum) { // Fake block mining. It broadcasts a new block every 5 seconds go func() { - data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) - keyRing := ethutil.NewValueFromBytes(data) - addr := keyRing.Get(0).Bytes() + keyPair := ethutil.GetKeyRing().Get(0) + addr := keyPair.Address() - pair, _ := ethchain.NewKeyPairFromSec(ethutil.FromHex(hex.EncodeToString(addr))) - - miner := ethminer.NewDefaultMiner(pair.Address(), ethereum) + miner := ethminer.NewDefaultMiner(addr, ethereum) miner.Start() }() |