Hoist Arc<Bank>

This commit is contained in:
Greg Fitzgerald
2018-08-22 17:54:22 -06:00
committed by Grimes
parent a133784706
commit 731f8512c6

View File

@ -121,12 +121,13 @@ impl Fullnode {
ledger_path: Option<&str>, ledger_path: Option<&str>,
sigverify_disabled: bool, sigverify_disabled: bool,
) -> Self { ) -> Self {
let bank = Arc::new(bank);
let thread_hdls = match leader_info { let thread_hdls = match leader_info {
Some(leader_info) => { Some(leader_info) => {
// Start in validator mode. // Start in validator mode.
Self::create_validator_threads( Self::create_validator_threads(
keypair, keypair,
bank, &bank,
entry_height, entry_height,
&ledger_tail, &ledger_tail,
node, node,
@ -142,7 +143,7 @@ impl Fullnode {
Self::create_leader_threads( Self::create_leader_threads(
keypair, keypair,
bank, &bank,
entry_height, entry_height,
&ledger_tail, &ledger_tail,
node, node,
@ -182,7 +183,7 @@ impl Fullnode {
/// ``` /// ```
fn create_leader_threads( fn create_leader_threads(
keypair: Keypair, keypair: Keypair,
bank: Bank, bank: &Arc<Bank>,
entry_height: u64, entry_height: u64,
ledger_tail: &[Entry], ledger_tail: &[Entry],
node: TestNode, node: TestNode,
@ -194,7 +195,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 bank = Arc::new(bank);
let mut thread_hdls = vec![]; let mut thread_hdls = vec![];
let rpu = Rpu::new( let rpu = Rpu::new(
&bank, &bank,
@ -288,7 +288,7 @@ impl Fullnode {
/// ``` /// ```
fn create_validator_threads( fn create_validator_threads(
keypair: Keypair, keypair: Keypair,
bank: Bank, bank: &Arc<Bank>,
entry_height: u64, entry_height: u64,
ledger_tail: &[Entry], ledger_tail: &[Entry],
node: TestNode, node: TestNode,
@ -297,7 +297,6 @@ impl Fullnode {
ledger_path: Option<&str>, ledger_path: Option<&str>,
_sigverify_disabled: bool, _sigverify_disabled: bool,
) -> Vec<JoinHandle<()>> { ) -> Vec<JoinHandle<()>> {
let bank = Arc::new(bank);
let mut thread_hdls = vec![]; let mut thread_hdls = vec![];
let rpu = Rpu::new( let rpu = Rpu::new(
&bank, &bank,