Check for default leader and use cmp::max for a bit nicer code (#779)

This commit is contained in:
sakridge
2018-07-27 15:53:31 -07:00
committed by anatoly yakovenko
parent 7f4844f426
commit 0b47404ba6
2 changed files with 28 additions and 4 deletions

View File

@ -16,6 +16,7 @@ use solana::signature::{KeyPair, KeyPairUtil, PublicKey};
use solana::streamer::default_window;
use solana::thin_client::ThinClient;
use solana::timing::duration_as_s;
use std::cmp::max;
use std::env;
use std::fs::File;
use std::net::UdpSocket;
@ -503,9 +504,7 @@ fn test_multi_node_dynamic_network() {
);
let bal = getbal.unwrap_or(0);
let distance = (leader_balance - bal) / 500;
if distance > max_distance {
max_distance = distance;
}
max_distance = max(distance, max_distance);
total_distance += distance;
if let Some(bal) = getbal {
if bal == leader_balance {