Check before borrow, fixes #267

This commit is contained in:
Ignotus Peverell 2017-12-03 12:46:00 +00:00 committed by Simon B
parent 1a86900bac
commit cac6181c21

View file

@ -249,7 +249,7 @@ impl NetAdapter for NetToChainAdapter {
self.total_height()
);
if self.p2p_server.is_initialized() {
if diff.into_num() > 0 && self.p2p_server.is_initialized() {
if let Some(peer) = self.p2p_server.borrow().get_peer(&addr) {
let mut peer = peer.write().unwrap();
peer.info.total_difficulty = diff;