pub struct BestChain {
pub best_block: BlockHash,
pub depth: u32,
pub validation_index: BlockHash,
pub alternative_tips: Vec<BlockHash>,
pub assume_valid_index: u32,
}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 has too little work if compared to our best one
assume_valid_index: u32Saves the height occupied by the assume valid block
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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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