diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index a1079724a7..2cc0e5e1e4 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -477,7 +477,7 @@ func (ps *peerSet) HeaderIdlePeers() ([]*peerConnection, int) { defer p.lock.RUnlock() return p.headerThroughput } - return ps.idlePeers(62, 64, idle, throughput) + return ps.idlePeers(62, 101, idle, throughput) } // BodyIdlePeers retrieves a flat list of all the currently body-idle peers within @@ -491,7 +491,7 @@ func (ps *peerSet) BodyIdlePeers() ([]*peerConnection, int) { defer p.lock.RUnlock() return p.blockThroughput } - return ps.idlePeers(62, 64, idle, throughput) + return ps.idlePeers(62, 101, idle, throughput) } // ReceiptIdlePeers retrieves a flat list of all the currently receipt-idle peers @@ -505,7 +505,7 @@ func (ps *peerSet) ReceiptIdlePeers() ([]*peerConnection, int) { defer p.lock.RUnlock() return p.receiptThroughput } - return ps.idlePeers(63, 64, idle, throughput) + return ps.idlePeers(63, 101, idle, throughput) } // NodeDataIdlePeers retrieves a flat list of all the currently node-data-idle @@ -519,7 +519,7 @@ func (ps *peerSet) NodeDataIdlePeers() ([]*peerConnection, int) { defer p.lock.RUnlock() return p.stateThroughput } - return ps.idlePeers(63, 64, idle, throughput) + return ps.idlePeers(63, 101, idle, throughput) } // idlePeers retrieves a flat list of all currently idle peers satisfying the diff --git a/eth/protocol.go b/eth/protocol.go index cb4d21bbbb..64b4883684 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -30,18 +30,19 @@ import ( // Constants to match up protocol versions and messages const ( - eth62 = 62 - eth63 = 63 + eth62 = 62 + eth63 = 63 + xdpos2 = 100 ) // Official short name of the protocol used during capability negotiation. var ProtocolName = "eth" // Supported versions of the eth protocol (first is primary). -var ProtocolVersions = []uint{eth63, eth62} +var ProtocolVersions = []uint{xdpos2, eth63, eth62} // Number of implemented message corresponding to different protocol versions. -var ProtocolLengths = []uint64{227, 8} +var ProtocolLengths = []uint64{227, 17, 8} const ProtocolMaxMsgSize = 10 * 1024 * 1024 // Maximum cap on the size of a protocol message @@ -64,7 +65,7 @@ const ( GetReceiptsMsg = 0x0f ReceiptsMsg = 0x10 - // Protocol messages belonging to eth/100 + // Protocol messages belonging to xdpos2/100 VoteMsg = 0xe0 TimeoutMsg = 0xe1 SyncInfoMsg = 0xe2