Skip to content

Commit

Permalink
builds!
Browse files Browse the repository at this point in the history
  • Loading branch information
aeyakovenko committed Jan 19, 2019
1 parent a98ab23 commit 8ee8f1a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
9 changes: 6 additions & 3 deletions src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ impl Bank {
}
}

pub fn trunk_fork(&self) -> BankState {
self.forks.read().unwrap().trunk_fork()
}

#[must_use]
fn process_and_record_transactions_on_fork(
&self,
Expand Down Expand Up @@ -372,7 +376,7 @@ impl Bank {
{
let block: Vec<Entry> = group.collect();

if !Entry::verify_many(&block, &last_id) {
if !block.as_slice().verify(&last_id) {
warn!("Ledger proof of history failed at entry: {}", entry_height);
return Err(BankError::LedgerVerificationFailed);
}
Expand All @@ -384,8 +388,7 @@ impl Bank {
self.init_fork(new, &block[0].id, base)
.expect("initializing fork for replay");
//there is only one base, and its the current live fork
let new_trunk = self
.forks
self.forks
.write()
.unwrap()
.merge_into_trunk(base, new)
Expand Down
2 changes: 1 addition & 1 deletion src/compute_leader_finality_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ComputeLeaderFinalityService {
// process_transaction(), case VoteInstruction::RegisterAccount), this will be more accurate.
// See github issue 1654.
let state = bank.trunk_fork();
let accounts = state.accounts.accounts_db.read().unwrap();
let accounts = state.head().accounts.accounts_db.read().unwrap();
accounts
.accounts
.iter()
Expand Down
11 changes: 0 additions & 11 deletions src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,6 @@ impl Entry {
}
true
}
pub fn verify_many(entries: &[Self], start_hash: &Hash) -> bool {
let mut hash = *start_hash;
for e in entries {
if !e.verify(&hash) {
return false;
}
hash = e.id;
}
true
}

pub fn is_tick(&self) -> bool {
self.transactions.is_empty()
}
Expand Down
2 changes: 1 addition & 1 deletion src/leader_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ impl LeaderScheduler {

{
let state = bank.trunk_fork();
let accounts = state.accounts.accounts_db.read().unwrap();
let accounts = state.head().accounts.accounts_db.read().unwrap();

// TODO: iterate through checkpoints, too
accounts
Expand Down
8 changes: 4 additions & 4 deletions src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ impl ReplayStage {
/// Process entry blobs, already in order
fn process_entries(
bank: &Arc<Bank>,
cluster_info: &Arc<RwLock<ClusterInfo>>,
_cluster_info: &Arc<RwLock<ClusterInfo>>,
window_receiver: &EntryReceiver,
keypair: &Arc<Keypair>,
vote_account_keypair: &Arc<Keypair>,
vote_blob_sender: Option<&BlobSender>,
_keypair: &Arc<Keypair>,
_vote_account_keypair: &Arc<Keypair>,
_vote_blob_sender: Option<&BlobSender>,
ledger_entry_sender: &EntrySender,
entry_height: &mut u64,
last_entry_id: &mut Hash,
Expand Down

0 comments on commit 8ee8f1a

Please sign in to comment.