Fixed more duplicate peers from exchange.
This commit is contained in:
+1
-1
@@ -330,7 +330,7 @@ fn handle_message(context: Arc<Mutex<Context>>, message: Message, peers: &mut Pe
|
|||||||
let mut context = context.lock().unwrap();
|
let mut context = context.lock().unwrap();
|
||||||
match context.blockchain.add_block(block) {
|
match context.blockchain.add_block(block) {
|
||||||
Ok(_) => { context.bus.post(crate::event::Event::BlockchainChanged); }
|
Ok(_) => { context.bus.post(crate::event::Event::BlockchainChanged); }
|
||||||
Err(_) => { warn!("Error adding received block"); }
|
Err(_) => { warn!("Discarded received block"); }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
State::idle()
|
State::idle()
|
||||||
|
|||||||
@@ -73,6 +73,14 @@ impl Peers {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.new_peers
|
||||||
|
.iter()
|
||||||
|
.find(|a| a.clone().eq(&addr))
|
||||||
|
.is_some() {
|
||||||
|
debug!("Skipping address from exchange: {}", &addr);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if skip_addr(&addr) {
|
if skip_addr(&addr) {
|
||||||
debug!("Skipping address from exchange: {}", &addr);
|
debug!("Skipping address from exchange: {}", &addr);
|
||||||
continue; // Return error in future
|
continue; // Return error in future
|
||||||
|
|||||||
Reference in New Issue
Block a user