mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
Correct cache race condition
This commit is contained in:
@@ -2,7 +2,7 @@ use beacon_chain::BeaconChain as RawBeaconChain;
|
||||
use beacon_chain::{
|
||||
db::ClientDB,
|
||||
fork_choice::ForkChoice,
|
||||
parking_lot::RwLockReadGuard,
|
||||
parking_lot::{RwLockReadGuard, RwLockWriteGuard},
|
||||
slot_clock::SlotClock,
|
||||
types::{BeaconState, ChainSpec, Signature},
|
||||
AttestationValidationError, BlockProductionError,
|
||||
@@ -16,6 +16,8 @@ pub trait BeaconChain: Send + Sync {
|
||||
|
||||
fn get_state(&self) -> RwLockReadGuard<BeaconState>;
|
||||
|
||||
fn get_mut_state(&self) -> RwLockWriteGuard<BeaconState>;
|
||||
|
||||
fn process_block(&self, block: BeaconBlock)
|
||||
-> Result<BlockProcessingOutcome, BeaconChainError>;
|
||||
|
||||
@@ -46,6 +48,10 @@ where
|
||||
self.state.read()
|
||||
}
|
||||
|
||||
fn get_mut_state(&self) -> RwLockWriteGuard<BeaconState> {
|
||||
self.state.write()
|
||||
}
|
||||
|
||||
fn process_block(
|
||||
&self,
|
||||
block: BeaconBlock,
|
||||
|
||||
Reference in New Issue
Block a user