Fix merge conflicts

This commit is contained in:
Maran
2014-05-14 14:04:43 +02:00
11 changed files with 107 additions and 72 deletions

View File

@ -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()
}()
}