pub struct Shared {
pub header_map: Arc<HeaderMap>,
/* private fields */
}
Expand description
TODO(doc): @quake
Fields§
§header_map: Arc<HeaderMap>
Implementations§
Sourcepub fn new(
store: ChainDB,
tx_pool_controller: TxPoolController,
notify_controller: NotifyController,
txs_verify_cache: Arc<TokioRwLock<TxVerificationCache>>,
consensus: Arc<Consensus>,
snapshot_mgr: Arc<SnapshotMgr>,
async_handle: Handle,
ibd_finished: Arc<AtomicBool>,
assume_valid_targets: Arc<Mutex<Option<Vec<H256>>>>,
assume_valid_target_specified: Arc<Option<H256>>,
header_map: Arc<HeaderMap>,
block_status_map: Arc<DashMap<Byte32, BlockStatus>>,
) -> Shared
pub fn new( store: ChainDB, tx_pool_controller: TxPoolController, notify_controller: NotifyController, txs_verify_cache: Arc<TokioRwLock<TxVerificationCache>>, consensus: Arc<Consensus>, snapshot_mgr: Arc<SnapshotMgr>, async_handle: Handle, ibd_finished: Arc<AtomicBool>, assume_valid_targets: Arc<Mutex<Option<Vec<H256>>>>, assume_valid_target_specified: Arc<Option<H256>>, header_map: Arc<HeaderMap>, block_status_map: Arc<DashMap<Byte32, BlockStatus>>, ) -> Shared
Construct new Shared
Sourcepub fn spawn_freeze(&self) -> Option<FreezerClose>
pub fn spawn_freeze(&self) -> Option<FreezerClose>
Spawn freeze background thread that periodically checks and moves ancient data from the kv database into the freezer.
Sourcepub fn tx_pool_controller(&self) -> &TxPoolController
pub fn tx_pool_controller(&self) -> &TxPoolController
TODO(doc): @quake
Sourcepub fn txs_verify_cache(&self) -> Arc<TokioRwLock<TxVerificationCache>>
pub fn txs_verify_cache(&self) -> Arc<TokioRwLock<TxVerificationCache>>
TODO(doc): @quake
Sourcepub fn notify_controller(&self) -> &NotifyController
pub fn notify_controller(&self) -> &NotifyController
TODO(doc): @quake
Sourcepub fn cloned_snapshot(&self) -> Arc<Snapshot>
pub fn cloned_snapshot(&self) -> Arc<Snapshot>
Return arc cloned snapshot
Sourcepub fn store_snapshot(&self, snapshot: Arc<Snapshot>)
pub fn store_snapshot(&self, snapshot: Arc<Snapshot>)
TODO(doc): @quake
Sourcepub fn refresh_snapshot(&self)
pub fn refresh_snapshot(&self)
TODO(doc): @quake
Sourcepub fn new_snapshot(
&self,
tip_header: HeaderView,
total_difficulty: U256,
epoch_ext: EpochExt,
proposals: ProposalView,
) -> Arc<Snapshot>
pub fn new_snapshot( &self, tip_header: HeaderView, total_difficulty: U256, epoch_ext: EpochExt, proposals: ProposalView, ) -> Arc<Snapshot>
TODO(doc): @quake
Sourcepub fn cloned_consensus(&self) -> Arc<Consensus>
pub fn cloned_consensus(&self) -> Arc<Consensus>
Return arc cloned consensus re
Sourcepub fn async_handle(&self) -> &Handle
pub fn async_handle(&self) -> &Handle
Return async runtime handle
Sourcepub fn genesis_hash(&self) -> Byte32
pub fn genesis_hash(&self) -> Byte32
TODO(doc): @quake
Sourcepub fn is_initial_block_download(&self) -> bool
pub fn is_initial_block_download(&self) -> bool
Return whether chain is in initial block download
Sourcepub fn get_block_template(
&self,
bytes_limit: Option<u64>,
proposals_limit: Option<u64>,
max_version: Option<Version>,
) -> Result<Result<BlockTemplate, AnyError>, AnyError>
pub fn get_block_template( &self, bytes_limit: Option<u64>, proposals_limit: Option<u64>, max_version: Option<Version>, ) -> Result<Result<BlockTemplate, AnyError>, AnyError>
Generate and return block_template
pub fn set_unverified_tip(&self, header: HeaderIndex)
pub fn get_unverified_tip(&self) -> HeaderIndex
pub fn header_map(&self) -> &HeaderMap
pub fn remove_header_view(&self, hash: &Byte32)
pub fn block_status_map(&self) -> &DashMap<Byte32, BlockStatus>
pub fn get_block_status(&self, block_hash: &Byte32) -> BlockStatus
pub fn contains_block_status<T: ChainStore>( &self, block_hash: &Byte32, status: BlockStatus, ) -> bool
pub fn insert_block_status(&self, block_hash: Byte32, status: BlockStatus)
pub fn remove_block_status(&self, block_hash: &Byte32)
pub fn assume_valid_targets(&self) -> MutexGuard<'_, Option<Vec<H256>>>
pub fn assume_valid_target_specified(&self) -> Arc<Option<H256>>
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more