mirror of
https://github.com/mimblewimble/grin.git
synced 2025-05-08 18:21:14 +03:00
Check before borrow, fixes #267
This commit is contained in:
parent
17d5898677
commit
f8a9526279
1 changed files with 1 additions and 1 deletions
|
@ -263,7 +263,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;
|
||||
|
|
Loading…
Add table
Reference in a new issue