From 6c15a47accc750ed072d1d2f8fad59b8b4d859ae Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Tue, 26 Jul 2016 10:44:01 +0200 Subject: [PATCH] Fix importing blocks from a pipe file (#1724) --- parity/blockchain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity/blockchain.rs b/parity/blockchain.rs index 5843b9d03..2302d881c 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -194,7 +194,7 @@ fn execute_import(cmd: ImportBlockchain) -> Result { first_read = 0; let s = try!(PayloadInfo::from(&bytes).map_err(|e| format!("Invalid RLP in the file/stream: {:?}", e))).total(); bytes.resize(s, 0); - try!(instream.read_exact(&mut bytes[READAHEAD_BYTES..]).map_err(|_| "Error reading from the file/stream.")); + try!(instream.read_exact(&mut bytes[n..]).map_err(|_| "Error reading from the file/stream.")); try!(do_import(bytes)); } }