pub struct BestChain {
pub best_block: BlockHash,
pub depth: u32,
pub validation_index: BlockHash,
pub alternative_tips: Vec<BlockHash>,
}Expand description
Internal representation of the chain we are in
Fields§
§best_block: BlockHashHash of the last block in the chain we believe has more work on
depth: u32How many blocks are pilled on this chain?
validation_index: BlockHashWe actually validated blocks up to this point
alternative_tips: Vec<BlockHash>Blockchains are not fast-forward only, they might have “forks”, sometimes it’s useful to keep track of them, in case they become the best one. This keeps track of some tips we know about, but are not the best one. We don’t keep tips that are too deep or have too little work if compared to our best one
Implementations§
Trait Implementations§
impl Eq for BestChain
impl StructuralPartialEq for BestChain
Auto Trait Implementations§
impl Freeze for BestChain
impl RefUnwindSafe for BestChain
impl Send for BestChain
impl Sync for BestChain
impl Unpin for BestChain
impl UnwindSafe for BestChain
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.