aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethereum
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ethereum')
-rw-r--r--cmd/ethereum/js.go6
-rw-r--r--cmd/ethereum/main.go13
2 files changed, 7 insertions, 12 deletions
diff --git a/cmd/ethereum/js.go b/cmd/ethereum/js.go
index 5432fb9b1..3b98b588e 100644
--- a/cmd/ethereum/js.go
+++ b/cmd/ethereum/js.go
@@ -249,12 +249,14 @@ func (self *jsre) dump(call otto.FunctionCall) otto.Value {
}
func (self *jsre) stopMining(call otto.FunctionCall) otto.Value {
- self.xeth.Miner().Stop()
+ self.ethereum.StopMining()
return otto.TrueValue()
}
func (self *jsre) startMining(call otto.FunctionCall) otto.Value {
- self.xeth.Miner().Start()
+ if err := self.ethereum.StartMining(); err != nil {
+ return otto.FalseValue()
+ }
return otto.TrueValue()
}
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go
index 73c67bdc9..8b01457e6 100644
--- a/cmd/ethereum/main.go
+++ b/cmd/ethereum/main.go
@@ -30,7 +30,6 @@ import (
"time"
"github.com/codegangsta/cli"
- "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
@@ -158,10 +157,7 @@ func run(ctx *cli.Context) {
fmt.Printf("Welcome to the FRONTIER\n")
utils.HandleInterrupt()
eth, err := utils.GetEthereum(ClientIdentifier, Version, ctx)
- if err == accounts.ErrNoKeys {
- utils.Fatalf(`No accounts configured.
-Please run 'ethereum account new' to create a new account.`)
- } else if err != nil {
+ if err != nil {
utils.Fatalf("%v", err)
}
@@ -172,10 +168,7 @@ Please run 'ethereum account new' to create a new account.`)
func runjs(ctx *cli.Context) {
eth, err := utils.GetEthereum(ClientIdentifier, Version, ctx)
- if err == accounts.ErrNoKeys {
- utils.Fatalf(`No accounts configured.
-Please run 'ethereum account new' to create a new account.`)
- } else if err != nil {
+ if err != nil {
utils.Fatalf("%v", err)
}
@@ -214,7 +207,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
utils.StartRPC(eth, ctx)
}
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
- eth.Miner().Start()
+ eth.StartMining()
}
}