[][src]Trait grin_pool::types::BlockChain

pub trait BlockChain: Sync + Send {
    fn verify_coinbase_maturity(&self, inputs: &Inputs) -> Result<(), PoolError>;
fn verify_tx_lock_height(&self, tx: &Transaction) -> Result<(), PoolError>;
fn validate_tx(&self, tx: &Transaction) -> Result<(), PoolError>;
fn validate_inputs(
        &self,
        inputs: &Inputs
    ) -> Result<Vec<OutputIdentifier>, PoolError>;
fn chain_head(&self) -> Result<BlockHeader, PoolError>;
fn get_block_header(&self, hash: &Hash) -> Result<BlockHeader, PoolError>;
fn get_block_sums(&self, hash: &Hash) -> Result<BlockSums, PoolError>; }

Interface that the pool requires from a blockchain implementation.

Required methods

fn verify_coinbase_maturity(&self, inputs: &Inputs) -> Result<(), PoolError>

Verify any coinbase outputs being spent have matured sufficiently.

fn verify_tx_lock_height(&self, tx: &Transaction) -> Result<(), PoolError>

Verify any coinbase outputs being spent have matured sufficiently.

fn validate_tx(&self, tx: &Transaction) -> Result<(), PoolError>

Validate a transaction against the current utxo.

fn validate_inputs(
    &self,
    inputs: &Inputs
) -> Result<Vec<OutputIdentifier>, PoolError>

Validate inputs against the current utxo. Returns the vec of output identifiers that would be spent by these inputs if they can all be successfully spent.

fn chain_head(&self) -> Result<BlockHeader, PoolError>

fn get_block_header(&self, hash: &Hash) -> Result<BlockHeader, PoolError>

fn get_block_sums(&self, hash: &Hash) -> Result<BlockSums, PoolError>

Loading content...

Implementors

Loading content...