bank: remove ambiguating "helper" method (#33606)
This commit is contained in:
parent
4c664a8d31
commit
55f3f203c6
|
@ -1793,14 +1793,10 @@ impl Bank {
|
||||||
a corrupted snapshot or bugs in cached accounts or accounts-db.",
|
a corrupted snapshot or bugs in cached accounts or accounts-db.",
|
||||||
);
|
);
|
||||||
let stakes_accounts_load_duration = now.elapsed();
|
let stakes_accounts_load_duration = now.elapsed();
|
||||||
fn new<T: Default>() -> T {
|
|
||||||
T::default()
|
|
||||||
}
|
|
||||||
let feature_set = new();
|
|
||||||
let mut bank = Self {
|
let mut bank = Self {
|
||||||
incremental_snapshot_persistence: fields.incremental_snapshot_persistence,
|
incremental_snapshot_persistence: fields.incremental_snapshot_persistence,
|
||||||
rc: bank_rc,
|
rc: bank_rc,
|
||||||
status_cache: new(),
|
status_cache: Arc::<RwLock<BankStatusCache>>::default(),
|
||||||
blockhash_queue: RwLock::new(fields.blockhash_queue),
|
blockhash_queue: RwLock::new(fields.blockhash_queue),
|
||||||
ancestors,
|
ancestors,
|
||||||
hash: RwLock::new(fields.hash),
|
hash: RwLock::new(fields.hash),
|
||||||
|
@ -1808,10 +1804,10 @@ impl Bank {
|
||||||
parent_slot: fields.parent_slot,
|
parent_slot: fields.parent_slot,
|
||||||
hard_forks: Arc::new(RwLock::new(fields.hard_forks)),
|
hard_forks: Arc::new(RwLock::new(fields.hard_forks)),
|
||||||
transaction_count: AtomicU64::new(fields.transaction_count),
|
transaction_count: AtomicU64::new(fields.transaction_count),
|
||||||
non_vote_transaction_count_since_restart: new(),
|
non_vote_transaction_count_since_restart: AtomicU64::default(),
|
||||||
transaction_error_count: new(),
|
transaction_error_count: AtomicU64::default(),
|
||||||
transaction_entries_count: new(),
|
transaction_entries_count: AtomicU64::default(),
|
||||||
transactions_per_entry_max: new(),
|
transactions_per_entry_max: AtomicU64::default(),
|
||||||
tick_height: AtomicU64::new(fields.tick_height),
|
tick_height: AtomicU64::new(fields.tick_height),
|
||||||
signature_count: AtomicU64::new(fields.signature_count),
|
signature_count: AtomicU64::new(fields.signature_count),
|
||||||
capitalization: AtomicU64::new(fields.capitalization),
|
capitalization: AtomicU64::new(fields.capitalization),
|
||||||
|
@ -1836,16 +1832,17 @@ impl Bank {
|
||||||
stakes_cache: StakesCache::new(stakes),
|
stakes_cache: StakesCache::new(stakes),
|
||||||
epoch_stakes: fields.epoch_stakes,
|
epoch_stakes: fields.epoch_stakes,
|
||||||
is_delta: AtomicBool::new(fields.is_delta),
|
is_delta: AtomicBool::new(fields.is_delta),
|
||||||
builtin_programs: new(),
|
builtin_programs: HashSet::<Pubkey>::default(),
|
||||||
runtime_config,
|
runtime_config,
|
||||||
rewards: new(),
|
rewards: RwLock::new(vec![]),
|
||||||
cluster_type: Some(genesis_config.cluster_type),
|
cluster_type: Some(genesis_config.cluster_type),
|
||||||
lazy_rent_collection: new(),
|
lazy_rent_collection: AtomicBool::default(),
|
||||||
rewards_pool_pubkeys: new(),
|
rewards_pool_pubkeys: Arc::<HashSet<Pubkey>>::default(),
|
||||||
transaction_debug_keys: debug_keys,
|
transaction_debug_keys: debug_keys,
|
||||||
transaction_log_collector_config: new(),
|
transaction_log_collector_config: Arc::<RwLock<TransactionLogCollectorConfig>>::default(
|
||||||
transaction_log_collector: new(),
|
),
|
||||||
feature_set: Arc::clone(&feature_set),
|
transaction_log_collector: Arc::<RwLock<TransactionLogCollector>>::default(),
|
||||||
|
feature_set: Arc::<FeatureSet>::default(),
|
||||||
drop_callback: RwLock::new(OptionalDropCallback(None)),
|
drop_callback: RwLock::new(OptionalDropCallback(None)),
|
||||||
freeze_started: AtomicBool::new(fields.hash != Hash::default()),
|
freeze_started: AtomicBool::new(fields.hash != Hash::default()),
|
||||||
vote_only_bank: false,
|
vote_only_bank: false,
|
||||||
|
|
Loading…
Reference in New Issue