Merge branch 'master' into remerge-264
Conflicts: sync/src/chain.rs
This commit is contained in:
@@ -379,7 +379,7 @@ impl ChainSync {
|
||||
trace!(target: "sync", "Ignored unexpected block bodies");
|
||||
return Ok(());
|
||||
}
|
||||
if self.state == SyncState::Waiting {
|
||||
if self.state == SyncState::Waiting {
|
||||
trace!(target: "sync", "Ignored block bodies while waiting");
|
||||
return Ok(());
|
||||
}
|
||||
@@ -1005,4 +1005,11 @@ impl ChainSync {
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Maintain other peers. Send out any new blocks and transactions
|
||||
pub fn maintain_sync(&mut self, io: &mut SyncIo) {
|
||||
if !io.chain().queue_info().full && self.state == SyncState::Waiting {
|
||||
self.state = SyncState::Idle;
|
||||
self.continue_sync(io);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ impl NetworkProtocolHandler<SyncMessage> for EthSync {
|
||||
|
||||
fn timeout(&self, io: &NetworkContext<SyncMessage>, _timer: TimerToken) {
|
||||
self.sync.write().unwrap().maintain_peers(&mut NetSyncIo::new(io, self.chain.deref()));
|
||||
self.sync.write().unwrap().maintain_sync(&mut NetSyncIo::new(io, self.chain.deref()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user