bitcoin-peerman 0.1.16-alpha.0

a manager for handling peers
Documentation
crate::ix!();

pub trait AlreadyHaveBlock {

    fn already_have_block(self: Arc<Self>, block_hash: &u256) -> bool;
}

impl AlreadyHaveBlock for PeerManager {

    #[EXCLUSIVE_LOCKS_REQUIRED(CS_MAIN)]
    fn already_have_block(self: Arc<Self>, block_hash: &u256) -> bool {
        
        self.chainman.get()
            .inner
            .blockman
            .lookup_block_index(block_hash)
            .is_some()
    }
}