Struct ckb_shared::shared::Shared
source · pub struct Shared { /* private fields */ }
Expand description
TODO(doc): @quake
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>
) -> 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> ) -> 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
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