[2.x.x] Use blocking IO in P2P to reduce CPU load (#2855)

* Use blocking IO in P2P to reduce CPU load
This commit is contained in:
hashmap
2019-07-12 23:17:38 +02:00
committed by GitHub
parent 1395074a25
commit d3dbafa80b
11 changed files with 138 additions and 240 deletions
+1 -2
View File
@@ -646,8 +646,7 @@ impl Chain {
/// TODO - Write this data to disk and validate the rebuilt kernel MMR.
pub fn kernel_data_write(&self, reader: &mut Read) -> Result<(), Error> {
let mut count = 0;
let mut stream =
StreamingReader::new(reader, ProtocolVersion::local(), Duration::from_secs(1));
let mut stream = StreamingReader::new(reader, ProtocolVersion::local());
while let Ok(_kernel) = TxKernelEntry::read(&mut stream) {
count += 1;
}