Struct ckb_sync::SyncShared [−][src]
pub struct SyncShared { /* fields omitted */ }Expand description
Sync state shared between sync and relayer protocol
Implementations
pub fn new(
shared: Shared,
sync_config: SyncConfig,
tx_relay_receiver: Receiver<TxVerificationResult>
) -> SyncShared
pub fn new(
shared: Shared,
sync_config: SyncConfig,
tx_relay_receiver: Receiver<TxVerificationResult>
) -> SyncShared
only use on test
pub fn with_tmpdir<P>(
shared: Shared,
sync_config: SyncConfig,
tmpdir: Option<P>,
tx_relay_receiver: Receiver<TxVerificationResult>
) -> SyncShared where
P: AsRef<Path>,
pub fn with_tmpdir<P>(
shared: Shared,
sync_config: SyncConfig,
tmpdir: Option<P>,
tx_relay_receiver: Receiver<TxVerificationResult>
) -> SyncShared where
P: AsRef<Path>,
Generate a global sync state through configuration
Shared chain db/config
Get snapshot with current chain
pub fn insert_new_block(
&self,
chain: &ChainController,
block: Arc<BlockView>
) -> Result<bool, CKBError>
pub fn insert_new_block(
&self,
chain: &ChainController,
block: Arc<BlockView>
) -> Result<bool, CKBError>
Insert new block to chain store
Try to find blocks from the orphan block pool that may no longer be orphan
Sync a new valid header, try insert to sync state
Get header view with hash
Check whether block has been inserted to chain store
Get epoch ext by block hash
Trait Implementations
TODO(doc): @quake
Return timestamp and block_number of the corresponding block_hash, and hash of parent block
Return past block median time, including the timestamp of the given one
Auto Trait Implementations
impl !RefUnwindSafe for SyncShared
impl Send for SyncShared
impl Sync for SyncShared
impl Unpin for SyncShared
impl !UnwindSafe for SyncShared
Blanket Implementations
Mutably borrows from an owned value. Read more