pub struct ChainStore { /* private fields */ }
Expand description
All chain-related database operations
Implementations§
Source§impl ChainStore
impl ChainStore
Sourcepub fn header_head(&self) -> Result<Tip, Error>
pub fn header_head(&self) -> Result<Tip, Error>
The current header head (may differ from chain head).
Sourcepub fn tail(&self) -> Result<Tip, Error>
pub fn tail(&self) -> Result<Tip, Error>
The current chain “tail” (earliest block in the store).
Sourcepub fn head_header(&self) -> Result<BlockHeader, Error>
pub fn head_header(&self) -> Result<BlockHeader, Error>
Header of the block at the head of the block chain (not the same thing as header_head).
Sourcepub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
pub fn get_block_sums(&self, h: &Hash) -> Result<BlockSums, Error>
Get block_sums for the block hash.
Sourcepub fn get_previous_header(
&self,
header: &BlockHeader,
) -> Result<BlockHeader, Error>
pub fn get_previous_header( &self, header: &BlockHeader, ) -> Result<BlockHeader, Error>
Get previous header.
Sourcepub fn get_previous_header_skip_proof(
&self,
header: &BlockHeader,
) -> Result<BlockHeader, Error>
pub fn get_previous_header_skip_proof( &self, header: &BlockHeader, ) -> Result<BlockHeader, Error>
Get previous header without deserializing the proof nonces
Sourcepub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
pub fn get_block_header(&self, h: &Hash) -> Result<BlockHeader, Error>
Get block header.
Sourcepub fn get_block_header_skip_proof(
&self,
h: &Hash,
) -> Result<BlockHeader, Error>
pub fn get_block_header_skip_proof( &self, h: &Hash, ) -> Result<BlockHeader, Error>
Get block header without deserializing the full PoW Proof; currently used for difficulty iterator which is called many times but doesn’t need the proof
Sourcepub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
pub fn get_output_pos(&self, commit: &Commitment) -> Result<u64, Error>
Get PMMR pos for the given output commitment.
Sourcepub fn get_output_pos_height(
&self,
commit: &Commitment,
) -> Result<Option<CommitPos>, Error>
pub fn get_output_pos_height( &self, commit: &Commitment, ) -> Result<Option<CommitPos>, Error>
Get PMMR pos and block height for the given output commitment.
Sourcepub fn batch_read(&self) -> Result<Batch<'_>, Error>
pub fn batch_read(&self) -> Result<Batch<'_>, Error>
Builds a new batch for read only access with this store.
Sourcepub fn batch_write(&self) -> Result<Batch<'_>, Error>
pub fn batch_write(&self) -> Result<Batch<'_>, Error>
Builds a new batch for write access to be used with this store.
Auto Trait Implementations§
impl Freeze for ChainStore
impl !RefUnwindSafe for ChainStore
impl Send for ChainStore
impl Sync for ChainStore
impl Unpin for ChainStore
impl !UnwindSafe for ChainStore
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> 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