We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49b2a32 commit e096884Copy full SHA for e096884
src/network/mod.rs
@@ -518,11 +518,11 @@ impl AddressBook {
518
if self.tried.is_empty() && self.new.is_empty() {
519
return None;
520
}
521
- let use_tried: bool = rand::random();
522
- if use_tried && !self.tried.is_empty() {
523
- return self.tried.select();
+ if rand::random() {
+ self.tried.select().or_else(|| self.new.select())
+ } else {
524
+ self.new.select().or_else(|| self.tried.select())
525
- self.new.select()
526
527
528
pub(crate) fn failed(&mut self, record: &Record) {
0 commit comments