Make sure downloaded blocks are unmarked on send error
This commit is contained in:
parent
468d761e5c
commit
f85e409ff7
@ -862,16 +862,12 @@ impl ChainSync {
|
|||||||
warn!(target:"sync", "Asking {:?} while requesting {:?}", peer.asking, asking);
|
warn!(target:"sync", "Asking {:?} while requesting {:?}", peer.asking, asking);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match sync.send(peer_id, packet_id, packet) {
|
let mut peer = self.peers.get_mut(&peer_id).unwrap();
|
||||||
Err(e) => {
|
peer.asking = asking;
|
||||||
debug!(target:"sync", "Error sending request: {:?}", e);
|
peer.ask_time = time::precise_time_s();
|
||||||
sync.disable_peer(peer_id);
|
if let Err(e) = sync.send(peer_id, packet_id, packet) {
|
||||||
}
|
debug!(target:"sync", "Error sending request: {:?}", e);
|
||||||
Ok(_) => {
|
sync.disable_peer(peer_id);
|
||||||
let mut peer = self.peers.get_mut(&peer_id).unwrap();
|
|
||||||
peer.asking = asking;
|
|
||||||
peer.ask_time = time::precise_time_s();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user