add freeze_lock() and fix par_process_entries() failure to detect self conflict (#4415)

* add freeze_lock and fix par_process_entries failure to detect self conflict

* fixup

* fixup
This commit is contained in:
Rob Walker
2019-05-23 17:35:15 -07:00
committed by GitHub
parent 943cd0a24a
commit 35e8f966e3
3 changed files with 131 additions and 22 deletions

View File

@@ -31,7 +31,7 @@ use solana_sdk::transaction::{Result, Transaction, TransactionError};
use std::borrow::Borrow;
use std::cmp;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{Arc, RwLock};
use std::sync::{Arc, RwLock, RwLockReadGuard};
use std::time::Instant;
type BankStatusCache = StatusCache<Result<()>>;
@@ -191,6 +191,10 @@ impl Bank {
self.slot
}
pub fn freeze_lock(&self) -> RwLockReadGuard<Hash> {
self.hash.read().unwrap()
}
pub fn hash(&self) -> Hash {
*self.hash.read().unwrap()
}