aboutsummaryrefslogtreecommitdiffstats
path: root/dex/downloader/peer.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-02-12 16:16:13 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit75b752809c56b4d4e4d1448e6bb5b0c54c4418f0 (patch)
treee82b9eb37f5d4babf94a0c884cee956dcc5bd85e /dex/downloader/peer.go
parent16ae42bce121e4be57309d5953c08b546a903702 (diff)
downloaddexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.gz
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.bz2
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.lz
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.xz
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.tar.zst
dexon-75b752809c56b4d4e4d1448e6bb5b0c54c4418f0.zip
dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg (#188)
* dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg So that we can dispatch the response msg to fetcher or downloader easily. * fixup! dex: Add a flag to GetBlockHeadersMsg and GetBlockBodiesMsg
Diffstat (limited to 'dex/downloader/peer.go')
-rw-r--r--dex/downloader/peer.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/dex/downloader/peer.go b/dex/downloader/peer.go
index 25c355df1..e1c6960f1 100644
--- a/dex/downloader/peer.go
+++ b/dex/downloader/peer.go
@@ -85,7 +85,7 @@ type LightPeer interface {
// Peer encapsulates the methods required to synchronise with a remote full peer.
type Peer interface {
LightPeer
- RequestBodies([]common.Hash) error
+ DownloadBodies([]common.Hash) error
RequestReceipts([]common.Hash) error
RequestNodeData([]common.Hash) error
}
@@ -106,8 +106,8 @@ func (w *lightPeerWrapper) RequestGovStateByHash(common.Hash) error {
// TODO(sonic): support this
panic("RequestGovStateByHash not supported in light client mode sync")
}
-func (w *lightPeerWrapper) RequestBodies([]common.Hash) error {
- panic("RequestBodies not supported in light client mode sync")
+func (w *lightPeerWrapper) DownloadBodies([]common.Hash) error {
+ panic("DownloadBodies not supported in light client mode sync")
}
func (w *lightPeerWrapper) RequestReceipts([]common.Hash) error {
panic("RequestReceipts not supported in light client mode sync")
@@ -182,7 +182,7 @@ func (p *peerConnection) FetchBodies(request *fetchRequest) error {
for _, header := range request.Headers {
hashes = append(hashes, header.Hash())
}
- go p.peer.RequestBodies(hashes)
+ go p.peer.DownloadBodies(hashes)
return nil
}