diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-09-01 22:35:14 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-10-19 15:03:09 +0800 |
commit | 92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8 (patch) | |
tree | 77a19060ee7b46cd7819894babe24130b952c4ca /eth/backend.go | |
parent | 10ed107ba2001d1aabba3d319ba88c5ce6e8fdc0 (diff) | |
download | dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.gz dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.bz2 dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.lz dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.xz dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.tar.zst dexon-92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8.zip |
cmd, eth: support switching client modes of operation
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eth/backend.go b/eth/backend.go index 9ec3c1440..04dd3767a 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -89,6 +89,7 @@ type Config struct { GenesisFile string GenesisBlock *types.Block // used by block tests Olympic bool + Mode Mode BlockChainVersion int SkipBcVersionCheck bool // e.g. blockchain export @@ -398,8 +399,9 @@ func New(config *Config) (*Ethereum, error) { eth.blockProcessor = core.NewBlockProcessor(chainDb, eth.pow, eth.blockchain, eth.EventMux()) eth.blockchain.SetProcessor(eth.blockProcessor) - eth.protocolManager = NewProtocolManager(config.NetworkId, eth.eventMux, eth.txPool, eth.pow, eth.blockchain, chainDb) - + if eth.protocolManager, err = NewProtocolManager(config.Mode, config.NetworkId, eth.eventMux, eth.txPool, eth.pow, eth.blockchain, chainDb); err != nil { + return nil, err + } eth.miner = miner.New(eth, eth.EventMux(), eth.pow) eth.miner.SetGasPrice(config.GasPrice) eth.miner.SetExtra(config.ExtraData) |