From 302f8a190f88d0ce9b065faea956c4bd9a3c7bfd Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 20 Sep 2016 17:36:56 +0800 Subject: [PATCH] Fix syncing with pv63 peers --- sync/src/chain.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 2e47b5617..565c53827 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -108,7 +108,6 @@ known_heap_size!(0, PeerInfo); type PacketDecodeError = DecoderError; -const PROTOCOL_VERSION: u8 = 64u8; const MAX_BODIES_TO_SEND: usize = 256; const MAX_HEADERS_TO_SEND: usize = 512; const MAX_NODE_DATA_TO_SEND: usize = 1024; @@ -1274,7 +1273,7 @@ impl ChainSync { let pv64 = io.eth_protocol_version(peer) >= 64; let mut packet = RlpStream::new_list(if pv64 { 7 } else { 5 }); let chain = io.chain().chain_info(); - packet.append(&(PROTOCOL_VERSION as u32)); + packet.append(&(io.eth_protocol_version(peer) as u32)); packet.append(&self.network_id); packet.append(&chain.total_difficulty); packet.append(&chain.best_block_hash);