aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-08-16 00:38:32 +0800
committerFelix Lange <fjl@twurst.com>2016-08-17 23:39:03 +0800
commit312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e (patch)
treee10f9cc260af1ce13cb67b02bbce9c17c3b09de2 /eth
parentd6625ac34dad741f5659ca1dad3b0179603d37f0 (diff)
downloaddexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar.gz
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar.bz2
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar.lz
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar.xz
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.tar.zst
dexon-312263c7d9457fe7c24aac8e42a4cf2efc6ccd8e.zip
cmd/utils, node: create account manager in package node
The account manager was previously created by packge cmd/utils as part of flag processing and then passed down into eth.Ethereum through its config struct. Since we are starting to create nodes which do not have eth.Ethereum as a registered service, the code was rearranged to register the account manager as its own service. Making it a service is ugly though and it doesn't really fix the root cause: creating nodes without eth.Ethereum requires duplicating lots of code. This commit splits utils.MakeSystemNode into three functions, making creation of other node/service configurations easier. It also moves the account manager into Node so it can be used by those configurations without requiring package eth.
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go
index c8a9af6ee..9b1ca306a 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -83,11 +83,10 @@ type Config struct {
PowShared bool
ExtraData []byte
- AccountManager *accounts.Manager
- Etherbase common.Address
- GasPrice *big.Int
- MinerThreads int
- SolcPath string
+ Etherbase common.Address
+ GasPrice *big.Int
+ MinerThreads int
+ SolcPath string
GpoMinGasPrice *big.Int
GpoMaxGasPrice *big.Int
@@ -160,7 +159,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
chainDb: chainDb,
dappDb: dappDb,
eventMux: ctx.EventMux,
- accountManager: config.AccountManager,
+ accountManager: ctx.AccountManager,
pow: pow,
shutdownChan: make(chan bool),
stopDbUpgrade: stopDbUpgrade,