aboutsummaryrefslogtreecommitdiffstats
path: root/dex/handler.go
diff options
context:
space:
mode:
authorSonic <sonic@cobinhood.com>2018-09-19 19:07:10 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-07 18:45:19 +0800
commit0d5a6bb7d34789c75a2d987d2cdb8820db1e59f6 (patch)
tree36a5439aa49e4ae5c06b45888c5a7fd36ee04674 /dex/handler.go
parent0c22089b134c6c212e65ced0614c3d58849ae840 (diff)
downloaddexon-0d5a6bb7d34789c75a2d987d2cdb8820db1e59f6.tar.gz
dexon-0d5a6bb7d34789c75a2d987d2cdb8820db1e59f6.tar.zst
dexon-0d5a6bb7d34789c75a2d987d2cdb8820db1e59f6.zip
dex: introduce dex64 and remove eth62, eth63
Diffstat (limited to 'dex/handler.go')
-rw-r--r--dex/handler.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/dex/handler.go b/dex/handler.go
index b9a354f42..21609a561 100644
--- a/dex/handler.go
+++ b/dex/handler.go
@@ -123,11 +123,6 @@ func NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, ne
// Initiate a sub-protocol for every implemented version we can handle
manager.SubProtocols = make([]p2p.Protocol, 0, len(ProtocolVersions))
for i, version := range ProtocolVersions {
- // Skip protocol version if incompatible with the mode of operation
- if mode == downloader.FastSync && version < eth63 {
- continue
- }
- // Compatible; initialise the sub-protocol
version := version // Closure for the run
manager.SubProtocols = append(manager.SubProtocols, p2p.Protocol{
Name: ProtocolName,
@@ -526,7 +521,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
}
- case p.version >= eth63 && msg.Code == GetNodeDataMsg:
+ case msg.Code == GetNodeDataMsg:
// Decode the retrieval message
msgStream := rlp.NewStream(msg.Payload, uint64(msg.Size))
if _, err := msgStream.List(); err != nil {
@@ -553,7 +548,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
return p.SendNodeData(data)
- case p.version >= eth63 && msg.Code == NodeDataMsg:
+ case msg.Code == NodeDataMsg:
// A batch of node state data arrived to one of our previous requests
var data [][]byte
if err := msg.Decode(&data); err != nil {
@@ -564,7 +559,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
log.Debug("Failed to deliver node state data", "err", err)
}
- case p.version >= eth63 && msg.Code == GetReceiptsMsg:
+ case msg.Code == GetReceiptsMsg:
// Decode the retrieval message
msgStream := rlp.NewStream(msg.Payload, uint64(msg.Size))
if _, err := msgStream.List(); err != nil {
@@ -600,7 +595,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
return p.SendReceiptsRLP(receipts)
- case p.version >= eth63 && msg.Code == ReceiptsMsg:
+ case msg.Code == ReceiptsMsg:
// A batch of receipts arrived to one of our previous requests
var receipts [][]*types.Receipt
if err := msg.Decode(&receipts); err != nil {