diff options
author | Sonic <sonic@dexon.org> | 2019-02-12 16:16:13 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | b3622c655271c594d19c78eb92b26c1f539ea31b (patch) | |
tree | a90ec42b2fdb9da67556b12e69e732d0c664a18f /dex/downloader/peer.go | |
parent | 4df167061e22b7e8e8e54eaf6e5d08fd30f884a2 (diff) | |
download | dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar.gz dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar.bz2 dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar.lz dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar.xz dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.tar.zst dexon-b3622c655271c594d19c78eb92b26c1f539ea31b.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.go | 8 |
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 } |