From f18ec51cb3959cc662bfc7b84314cd1d3b1541b5 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 14 May 2014 13:55:08 +0200 Subject: Switched to new keyring methods --- utils/cmd.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'utils/cmd.go') 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() }() -- cgit v1.2.3