Remove superfluous set_leader() usage

This commit is contained in:
Michael Vines
2019-03-08 19:39:26 -08:00
parent 4d5b832775
commit ac226c3e14
8 changed files with 2 additions and 17 deletions

View File

@ -120,7 +120,6 @@ impl Replicator {
info!("Creating cluster info....");
let mut cluster_info = ClusterInfo::new(node.info.clone(), keypair.clone());
cluster_info.set_entrypoint(leader_info.clone());
cluster_info.set_leader(leader_info.id);
let cluster_info = Arc::new(RwLock::new(cluster_info));
// Create Blocktree, eventually will simply repurpose the input

View File

@ -435,7 +435,6 @@ mod tests {
let leader = ContactInfo::new_with_socketaddr(&socketaddr!("127.0.0.1:1234"));
cluster_info.write().unwrap().insert_info(leader.clone());
cluster_info.write().unwrap().set_leader(leader.id);
let mut io = MetaIoHandler::default();
let rpc = RpcSolImpl;

View File

@ -18,7 +18,6 @@ use std::sync::{Arc, Mutex, RwLock};
use std::thread;
pub struct Tpu {
pub id: Pubkey,
fetch_stage: FetchStage,
sigverify_stage: SigVerifyStage,
banking_stage: BankingStage,
@ -60,7 +59,6 @@ impl Tpu {
);
Self {
id,
fetch_stage,
sigverify_stage,
banking_stage,

View File

@ -197,7 +197,6 @@ pub mod tests {
//start cluster_info1
let mut cluster_info1 = ClusterInfo::new_with_invalid_keypair(target1.info.clone());
cluster_info1.insert_info(leader.info.clone());
cluster_info1.set_leader(leader.info.id);
let cref1 = Arc::new(RwLock::new(cluster_info1));
let blocktree_path = get_tmp_ledger_path!();

View File

@ -172,10 +172,8 @@ mod test {
let leader_node = Node::new_localhost();
let validator_node = Node::new_localhost();
let exit = Arc::new(AtomicBool::new(false));
let mut cluster_info_me =
ClusterInfo::new_with_invalid_keypair(validator_node.info.clone());
let cluster_info_me = ClusterInfo::new_with_invalid_keypair(validator_node.info.clone());
let me_id = leader_node.info.id;
cluster_info_me.set_leader(me_id);
let subs = Arc::new(RwLock::new(cluster_info_me));
let (s_reader, r_reader) = channel();
@ -279,7 +277,6 @@ mod test {
}
s_responder.send(msgs).expect("send");
subs.write().unwrap().set_leader(me_id);
let mut msgs1 = Vec::new();
for v in 1..5 {
let i = 9 + v;