pub trait ConnectedBlock {
    type Tx: ConnectedTx + Send;

    // Required methods
    fn from(block_header: BlockHeader, block_hash: BlockHash) -> Self;
    fn add_tx(&mut self, tx: Self::Tx);
    fn connect(
        block: Block,
        tx_db: &TxDB,
        blk_index: &BlockIndex,
        blk_file: &BlkFile
    ) -> OpResult<Self>
       where Self: Sized;
}
Expand description

This type refer to Block structs where inputs are replaced by connected outputs.

Implementors:

  • SConnectedBlock
  • FConnectedBlock

Required Associated Types§

source

type Tx: ConnectedTx + Send

Associated output type.

Required Methods§

source

fn from(block_header: BlockHeader, block_hash: BlockHash) -> Self

Construct a ConnectedBlock from parts of a block.

Used in iter_connected.rs.

source

fn add_tx(&mut self, tx: Self::Tx)

Add a new transaction in this block.

Used in iter_connected.rs.

source

fn connect( block: Block, tx_db: &TxDB, blk_index: &BlockIndex, blk_file: &BlkFile ) -> OpResult<Self>where Self: Sized,

Construct a ConnectedBlock and connect the transactions.

Implementors§