aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-12-16 11:26:23 +0800
committerzsfelfoldi <zsfelfoldi@gmail.com>2016-06-16 23:36:38 +0800
commit3a97280ae889bb6852ba16e70750a37b2ed08473 (patch)
tree41e078895ddd76fe81b323539046b7d9df8b17b3 /cmd/geth/main.go
parenta38be3eb488a349693a9c9905ab015278281f8db (diff)
downloadgo-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar.gz
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar.bz2
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar.lz
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar.xz
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.tar.zst
go-tangerine-3a97280ae889bb6852ba16e70750a37b2ed08473.zip
eth: separate common and full node-specific API and backend service
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index c372430f1..623f8ac81 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -29,6 +29,7 @@ import (
"time"
"github.com/ethereum/ethash"
+ "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/console"
@@ -313,11 +314,10 @@ func startNode(ctx *cli.Context, stack *node.Node) {
utils.StartNode(stack)
// Unlock any account specifically requested
- var ethereum *eth.Ethereum
- if err := stack.Service(&ethereum); err != nil {
+ var accman *accounts.Manager
+ if err := stack.Service(&accman); err != nil {
utils.Fatalf("ethereum service not running: %v", err)
}
- accman := ethereum.AccountManager()
passwords := utils.MakePasswordList(ctx)
accounts := strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",")
@@ -328,6 +328,10 @@ func startNode(ctx *cli.Context, stack *node.Node) {
}
// Start auxiliary services if enabled
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
+ var ethereum *eth.FullNodeService
+ if err := stack.Service(&ethereum); err != nil {
+ utils.Fatalf("ethereum service not running: %v", err)
+ }
if err := ethereum.StartMining(ctx.GlobalInt(utils.MinerThreadsFlag.Name), ctx.GlobalString(utils.MiningGPUFlag.Name)); err != nil {
utils.Fatalf("Failed to start mining: %v", err)
}