Struct ckb_shared::Snapshot [−][src]
pub struct Snapshot { /* fields omitted */ }Expand description
A snapshot captures a point-in-time view of the DB at the time it’s created
Implementations
pub fn new(
tip_header: HeaderView,
total_difficulty: U256,
epoch_ext: EpochExt,
store: StoreSnapshot,
proposals: ProposalView,
consensus: Arc<Consensus>
) -> Snapshot
pub fn new(
tip_header: HeaderView,
total_difficulty: U256,
epoch_ext: EpochExt,
store: StoreSnapshot,
proposals: ProposalView,
consensus: Arc<Consensus>
) -> Snapshot
New snapshot created after tip change
Refreshing on block commit is necessary operation, even tip remains unchanged. when node relayed compact block,if some uncles were not available from receiver’s local sources, in GetBlockTransactions/BlockTransactions roundtrip, node will need access block data of uncles.
Return reference of tip header
Return tip header number
Makes a clone of the Arc<Consensus>
Return reference of proposals view
Return current best chain total_difficulty
pub fn finalize_block_reward(
&self,
parent: &HeaderView
) -> Result<(Script, BlockReward), Error>
pub fn finalize_block_reward(
&self,
parent: &HeaderView
) -> Result<(Script, BlockReward), Error>
Shortcuts for calculate block reward, invoke RewardCalculator
Trait Implementations
TODO(doc): @quake
type Vector = DBPinnableSlice<'a>
type Vector = DBPinnableSlice<'a>
TODO(doc): @quake
TODO(doc): @quake
Return the bytes associated with a key value and the given column family.
TODO(doc): @quake
TODO(doc): @quake
Gets current epoch ext
TODO(doc): @quake
Return the provider trait default implementation
Get header by block header hash
Get block body by block header hash
Get unfrozen block from ky-store with given hash
Get all transaction-hashes in block body by block header hash
Get proposal short id by block header hash
Get block uncles by block header hash
Get block ext by block header hash
Get block header hash by block number
Get block number by block header hash
TODO(doc): @quake
Returns true if the transaction confirmed in main chain. Read more
Get commit transaction and block hash by its hash
TODO(doc): @quake
fn get_transaction_with_info(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)>
fn get_transaction_with_info(
&'a self,
hash: &Byte32
) -> Option<(TransactionView, TransactionInfo)>
Gets transaction and associated info with correspond hash
Gets cell meta data with out_point
TODO(doc): @quake
Gets epoch ext by epoch index
Gets epoch index by epoch number
Gets epoch index by block hash
TODO(doc): @quake
Gets header by uncle header hash
TODO(doc): @quake
Gets cellbase by block hash
TODO(doc): @quake
TODO(doc): @quake
Check if header in main chain
TODO(doc): @quake
Return timestamp and block_number of the corresponding block_hash, and hash of parent block
fn block_median_time(
&self,
block_hash: &Byte32,
median_block_count: usize
) -> u64
fn block_median_time(
&self,
block_hash: &Byte32,
median_block_count: usize
) -> u64
Return past block median time, including the timestamp of the given one