mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-22 03:51:08 +03:00
Check before borrow, fixes #267
This commit is contained in:
parent
1a86900bac
commit
cac6181c21
1 changed files with 2 additions and 2 deletions
|
@ -249,7 +249,7 @@ impl NetAdapter for NetToChainAdapter {
|
||||||
self.total_height()
|
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) {
|
if let Some(peer) = self.p2p_server.borrow().get_peer(&addr) {
|
||||||
let mut peer = peer.write().unwrap();
|
let mut peer = peer.write().unwrap();
|
||||||
peer.info.total_difficulty = diff;
|
peer.info.total_difficulty = diff;
|
||||||
|
|
Loading…
Reference in a new issue