aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-11-09 14:49:23 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commit6b9db92147972dacc9999f9fa63df1fa712b05d6 (patch)
tree3b85ad84984a4dfc7518016ccf2017a36fc3cc9f /les
parentee4c3558200faa70624efcf7ff2afa4ae8b1f0f4 (diff)
downloaddexon-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 'les')
-rw-r--r--les/api_backend.go4
-rw-r--r--les/backend.go12
2 files changed, 8 insertions, 8 deletions
diff --git a/les/api_backend.go b/les/api_backend.go
index 49cb91be2..ab63be7d8 100644
--- a/les/api_backend.go
+++ b/les/api_backend.go
@@ -29,10 +29,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/light"
"github.com/dexon-foundation/dexon/params"
"github.com/dexon-foundation/dexon/rpc"
@@ -163,7 +163,7 @@ func (b *LesApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEven
return b.eth.blockchain.SubscribeRemovedLogsEvent(ch)
}
-func (b *LesApiBackend) Downloader() *downloader.Downloader {
+func (b *LesApiBackend) Downloader() ethapi.Downloader {
return b.eth.Downloader()
}
diff --git a/les/backend.go b/les/backend.go
index 651f26ba6..b56222bba 100644
--- a/les/backend.go
+++ b/les/backend.go
@@ -215,12 +215,12 @@ func (s *LightEthereum) ResetWithGenesisBlock(gb *types.Block) {
s.blockchain.ResetWithGenesisBlock(gb)
}
-func (s *LightEthereum) BlockChain() *light.LightChain { return s.blockchain }
-func (s *LightEthereum) TxPool() *light.TxPool { return s.txPool }
-func (s *LightEthereum) Engine() consensus.Engine { return s.engine }
-func (s *LightEthereum) LesVersion() int { return int(ClientProtocolVersions[0]) }
-func (s *LightEthereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader }
-func (s *LightEthereum) EventMux() *event.TypeMux { return s.eventMux }
+func (s *LightEthereum) BlockChain() *light.LightChain { return s.blockchain }
+func (s *LightEthereum) TxPool() *light.TxPool { return s.txPool }
+func (s *LightEthereum) Engine() consensus.Engine { return s.engine }
+func (s *LightEthereum) LesVersion() int { return int(ClientProtocolVersions[0]) }
+func (s *LightEthereum) Downloader() ethapi.Downloader { return s.protocolManager.downloader }
+func (s *LightEthereum) EventMux() *event.TypeMux { return s.eventMux }
// Protocols implements node.Service, returning all the currently configured
// network protocols to start.