Track import errors and restart sync
This commit is contained in:
parent
1e9b64a786
commit
fe14f6f160
@ -387,7 +387,10 @@ impl ChainSync {
|
||||
self.have_common_block = true;
|
||||
trace!(target: "sync", "Found common header {} ({})", number, hash);
|
||||
} else {
|
||||
trace!(target: "sync", "Header already in chain {} ({})", number, hash);
|
||||
trace!(target: "sync", "Header already in chain {} ({}), restarting", number, hash);
|
||||
self.restart(io);
|
||||
self.continue_sync(io);
|
||||
return Ok(());
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
@ -462,6 +465,12 @@ impl ChainSync {
|
||||
trace!(target: "sync", "Ignored block bodies while waiting");
|
||||
return Ok(());
|
||||
}
|
||||
if item_count == 0 {
|
||||
trace!(target: "sync", "No bodies returned, restarting");
|
||||
self.restart(io);
|
||||
self.continue_sync(io);
|
||||
return Ok(());
|
||||
}
|
||||
for i in 0..item_count {
|
||||
let body = try!(r.at(i));
|
||||
let tx = try!(body.at(0));
|
||||
|
Loading…
Reference in New Issue
Block a user