Fix importing blocks from a pipe file (#1724)

This commit is contained in:
Arkadiy Paronyan 2016-07-26 10:44:01 +02:00 committed by Gav Wood
parent 1cc6b2b976
commit 6c15a47acc
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ fn execute_import(cmd: ImportBlockchain) -> Result<String, String> {
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));
}
}