From 92f9a3e5fa29e0f05c81b348b87cab4f7a94f0c8 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Tue, 1 Sep 2015 17:35:14 +0300 Subject: cmd, eth: support switching client modes of operation --- eth/backend.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'eth/backend.go') 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) -- cgit