diff options
author | gary rong <garyrong0905@gmail.com> | 2018-08-03 16:33:37 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-03 16:33:37 +0800 |
commit | 51db5975cc5fb88db6a0dba1826b534fd4df29d7 (patch) | |
tree | 930f5a66d52c9bdcecd5596d7630fb48b0982cfd /eth/backend.go | |
parent | 70176cda0eedbb4ec9cde867e8f6cde63efa5a12 (diff) | |
download | dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar.gz dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar.bz2 dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar.lz dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar.xz dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.tar.zst dexon-51db5975cc5fb88db6a0dba1826b534fd4df29d7.zip |
consensus/ethash: move remote agent logic to ethash internal (#15853)
* consensus/ethash: start remote ggoroutine to handle remote mining
* consensus/ethash: expose remote miner api
* consensus/ethash: expose submitHashrate api
* miner, ethash: push empty block to sealer without waiting execution
* consensus, internal: add getHashrate API for ethash
* consensus: add three method for consensus interface
* miner: expose consensus engine running status to miner
* eth, miner: specify etherbase when miner created
* miner: commit new work when consensus engine is started
* consensus, miner: fix some logics
* all: delete useless interfaces
* consensus: polish a bit
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go index a18abdfb5..32946a0ab 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -166,6 +166,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.SyncMode, config.NetworkId, eth.eventMux, eth.txPool, eth.engine, eth.blockchain, chainDb); err != nil { return nil, err } + eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine) eth.miner.SetExtra(makeExtraData(config.ExtraData)) @@ -411,6 +412,7 @@ func (s *Ethereum) Start(srvr *p2p.Server) error { func (s *Ethereum) Stop() error { s.bloomIndexer.Close() s.blockchain.Stop() + s.engine.Close() s.protocolManager.Stop() if s.lesServer != nil { s.lesServer.Stop() @@ -421,6 +423,5 @@ func (s *Ethereum) Stop() error { s.chainDb.Close() close(s.shutdownChan) - return nil } |