Struct blocks_iterator::BlockExtra[][src]

pub struct BlockExtra {
    pub block: Block,
    pub block_hash: BlockHash,
    pub size: u32,
    pub next: Vec<BlockHash>,
    pub height: u32,
    pub outpoint_values: HashMap<OutPoint, TxOut>,
    pub tx_hashes: HashSet<Txid>,

The bitcoin block and additional metadata returned by the iterate method


block: Block

The bitcoin block

block_hash: BlockHash

The bitcoin block hash, same as block.block_hash() but result from hashing is cached

size: u32

The byte size of the block, as returned by in serialize(block).len()

next: Vec<BlockHash>

Hash of the blocks following this one, it’s a vec because during reordering they may be more than one because of reorgs, as a result from iterate, it’s just one.

height: u32

The height of the current block, number of blocks between this one and the genesis block

outpoint_values: HashMap<OutPoint, TxOut>

All the previous outputs of this block. Allowing to validate the script or computing the fee Note that when configuration skip_script_pubkey is true, the script is empty, when skip_prevout is true, this map is empty.

tx_hashes: HashSet<Txid>

Precomputed set of txid present in block


impl BlockExtra[src]

pub fn average_fee(&self) -> Option<f64>[src]

Returns the average transaction fee in the block

pub fn fee(&self) -> Option<u64>[src]

Returns the total fee of the block

pub fn tx_fee(&self, tx: &Transaction) -> Option<u64>[src]

Returns the fee of a transaction contained in the block

Trait Implementations

impl Debug for BlockExtra[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.