Struct bitcoin_indexed_chain::Chain
source · pub struct Chain { /* private fields */ }
Expand description
| An in-memory indexed chain of blocks. |
Implementations§
source§impl Chain
impl Chain
sourcepub fn genesis(&self) -> Option<Arc<BlockIndex>>
pub fn genesis(&self) -> Option<Arc<BlockIndex>>
| Returns the index entry for the genesis | block of this chain, or nullptr if none. |
sourcepub fn set_tip(&mut self, pindex: Option<Arc<BlockIndex>>)
pub fn set_tip(&mut self, pindex: Option<Arc<BlockIndex>>)
| Set/initialize a chain with a given | tip. |
sourcepub fn find_fork(
&self,
pindex: Option<Arc<BlockIndex>>
) -> Option<Arc<BlockIndex>>
pub fn find_fork( &self, pindex: Option<Arc<BlockIndex>> ) -> Option<Arc<BlockIndex>>
| Find the last common block between this | chain and a block index entry. |
sourcepub fn find_earliest_at_least(
&self,
n_time: i64,
height: i32
) -> Option<Arc<BlockIndex>>
pub fn find_earliest_at_least( &self, n_time: i64, height: i32 ) -> Option<Arc<BlockIndex>>
| Find the earliest block with timestamp | equal or greater than the given time | and height equal or greater than the | given height. |
Trait Implementations§
source§impl ChainHeight for Chain
impl ChainHeight for Chain
source§impl ChainNext for Chain
impl ChainNext for Chain
source§fn next(&self, pindex: Option<Arc<BlockIndex>>) -> Option<Arc<BlockIndex>>
fn next(&self, pindex: Option<Arc<BlockIndex>>) -> Option<Arc<BlockIndex>>
| Find the successor of a block in this | chain, or nullptr if the given index | is not found or is the tip. |
source§impl GetLocator<Arc<BlockIndex>> for Chain
impl GetLocator<Arc<BlockIndex>> for Chain
source§fn get_locator(&self, pindex: Option<Arc<BlockIndex>>) -> Self::LocatorType
fn get_locator(&self, pindex: Option<Arc<BlockIndex>>) -> Self::LocatorType
| Return a CBlockLocator that refers | to a block in this chain (by default the | tip). |
type LocatorType = BlockLocator
Auto Trait Implementations§
impl RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl UnwindSafe for Chain
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more