Hoist thread_hdls

This commit is contained in:
Greg Fitzgerald
2018-08-22 18:51:53 -06:00
committed by Grimes
parent d8820053af
commit 42229a1105

View File

@ -176,10 +176,10 @@ impl Fullnode {
} }
let bank = Arc::new(bank); let bank = Arc::new(bank);
let thread_hdls = match leader_info { let mut thread_hdls = vec![];
match leader_info {
Some(leader_info) => { Some(leader_info) => {
// Start in validator mode. // Start in validator mode.
let mut thread_hdls = vec![];
let rpu = Rpu::new( let rpu = Rpu::new(
&bank, &bank,
node.sockets.requests, node.sockets.requests,
@ -228,7 +228,6 @@ impl Fullnode {
); );
thread_hdls.extend(tvu.thread_hdls()); thread_hdls.extend(tvu.thread_hdls());
thread_hdls.extend(ncp.thread_hdls()); thread_hdls.extend(ncp.thread_hdls());
thread_hdls
} }
None => { None => {
// Start in leader mode. // Start in leader mode.
@ -237,7 +236,6 @@ impl Fullnode {
// TODO: To light up PoH, uncomment the following line: // TODO: To light up PoH, uncomment the following line:
//let tick_duration = Some(Duration::from_millis(1000)); //let tick_duration = Some(Duration::from_millis(1000));
let mut thread_hdls = vec![];
let rpu = Rpu::new( let rpu = Rpu::new(
&bank, &bank,
node.sockets.requests, node.sockets.requests,
@ -291,10 +289,8 @@ impl Fullnode {
blob_receiver, blob_receiver,
); );
thread_hdls.extend(broadcast_stage.thread_hdls()); thread_hdls.extend(broadcast_stage.thread_hdls());
thread_hdls
} }
}; }
Fullnode { exit, thread_hdls } Fullnode { exit, thread_hdls }
} }