diff options
Diffstat (limited to 'cmd/utils')
-rw-r--r-- | cmd/utils/cmd.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 723cfa887..2bd34d792 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -32,7 +32,6 @@ import ( "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/rlp" rpchttp "github.com/ethereum/go-ethereum/rpc/http" "github.com/ethereum/go-ethereum/state" @@ -169,32 +168,6 @@ func StartRpc(ethereum *eth.Ethereum, RpcListenAddress string, RpcPort int) { } } -var gminer *miner.Miner - -func GetMiner() *miner.Miner { - return gminer -} - -func StartMining(ethereum *eth.Ethereum) bool { - if !ethereum.Mining { - ethereum.Mining = true - addr := ethereum.KeyManager().Address() - - go func() { - clilogger.Infoln("Start mining") - if gminer == nil { - gminer = miner.New(addr, ethereum, 4) - } - gminer.Start() - }() - RegisterInterrupt(func(os.Signal) { - StopMining(ethereum) - }) - return true - } - return false -} - func FormatTransactionData(data string) []byte { d := ethutil.StringToByteFunc(data, func(s string) (ret []byte) { slice := regexp.MustCompile("\\n|\\s").Split(s, 1000000000) @@ -208,18 +181,6 @@ func FormatTransactionData(data string) []byte { return d } -func StopMining(ethereum *eth.Ethereum) bool { - if ethereum.Mining && gminer != nil { - gminer.Stop() - clilogger.Infoln("Stopped mining") - ethereum.Mining = false - - return true - } - - return false -} - // Replay block func BlockDo(ethereum *eth.Ethereum, hash []byte) error { block := ethereum.ChainManager().GetBlock(hash) |