diff options
author | Sonic <sonic@dexon.org> | 2018-11-09 14:49:23 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 6b9db92147972dacc9999f9fa63df1fa712b05d6 (patch) | |
tree | 3b85ad84984a4dfc7518016ccf2017a36fc3cc9f /eth | |
parent | ee4c3558200faa70624efcf7ff2afa4ae8b1f0f4 (diff) | |
download | dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar.gz dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar.bz2 dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar.lz dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar.xz dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.tar.zst dexon-6b9db92147972dacc9999f9fa63df1fa712b05d6.zip |
dex: use dex/downloader in dex
To compatible with ethereum code base, make Downloader a
interface in internal/ethapi
Diffstat (limited to 'eth')
-rw-r--r-- | eth/api_backend.go | 4 | ||||
-rw-r--r-- | eth/backend.go | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go index 358e3512e..b8a525f02 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -28,10 +28,10 @@ import ( "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" "github.com/dexon-foundation/dexon/core/vm" - "github.com/dexon-foundation/dexon/eth/downloader" "github.com/dexon-foundation/dexon/eth/gasprice" "github.com/dexon-foundation/dexon/ethdb" "github.com/dexon-foundation/dexon/event" + "github.com/dexon-foundation/dexon/internal/ethapi" "github.com/dexon-foundation/dexon/params" "github.com/dexon-foundation/dexon/rpc" ) @@ -189,7 +189,7 @@ func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.S return b.eth.TxPool().SubscribeNewTxsEvent(ch) } -func (b *EthAPIBackend) Downloader() *downloader.Downloader { +func (b *EthAPIBackend) Downloader() ethapi.Downloader { return b.eth.Downloader() } diff --git a/eth/backend.go b/eth/backend.go index 5e6d50ab1..50d7779a3 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -460,16 +460,16 @@ func (s *Ethereum) StopMining() { func (s *Ethereum) IsMining() bool { return s.miner.Mining() } func (s *Ethereum) Miner() *miner.Miner { return s.miner } -func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager } -func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain } -func (s *Ethereum) TxPool() *core.TxPool { return s.txPool } -func (s *Ethereum) EventMux() *event.TypeMux { return s.eventMux } -func (s *Ethereum) Engine() consensus.Engine { return s.engine } -func (s *Ethereum) ChainDb() ethdb.Database { return s.chainDb } -func (s *Ethereum) IsListening() bool { return true } // Always listening -func (s *Ethereum) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) } -func (s *Ethereum) NetVersion() uint64 { return s.networkID } -func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader } +func (s *Ethereum) AccountManager() *accounts.Manager { return s.accountManager } +func (s *Ethereum) BlockChain() *core.BlockChain { return s.blockchain } +func (s *Ethereum) TxPool() *core.TxPool { return s.txPool } +func (s *Ethereum) EventMux() *event.TypeMux { return s.eventMux } +func (s *Ethereum) Engine() consensus.Engine { return s.engine } +func (s *Ethereum) ChainDb() ethdb.Database { return s.chainDb } +func (s *Ethereum) IsListening() bool { return true } // Always listening +func (s *Ethereum) EthVersion() int { return int(s.protocolManager.SubProtocols[0].Version) } +func (s *Ethereum) NetVersion() uint64 { return s.networkID } +func (s *Ethereum) Downloader() ethapi.Downloader { return s.protocolManager.downloader } // Protocols implements node.Service, returning all the currently configured // network protocols to start. |