src/MicroCore.cpp
/**
     * Get block by its height
     *
     * returns true if success
     */
Get block by its height
returns true if success
Get block by its height returns true if success
bool
    MicroCore::get_block_by_height(const uint64_t& height, block& blk)
    {
        crypto::hash block_id;
        try
        {
            block_id = m_blockchain_storage.get_block_id_by_height(height);
        }
        catch (const exception& e)
        {
            cerr << e.what() << endl;
            return false;
        }
        if (!m_blockchain_storage.get_block_by_hash(block_id, blk))
        {
            cerr << "Block with hash " << block_id
                 << "and height " << height << " not found!"
                 << endl;
            return false;
        }
        return true;
    }
bool MicroCore :: get_block_by_height ( const uint64_t & height , block & blk ) { crypto :: hash block_id ; try { block_id = m_blockchain_storage . get_block_id_by_height ( height ) ; } catch ( const exception & e ) { cerr << e . what ( ) << endl ; return false ; } if ( ! m_blockchain_storage . get_block_by_hash ( block_id , blk ) ) { cerr << " " << block_id << " " << height << " " << endl ; return false ; } return true ; }
Get block by its height
 returns true if success
Get block by its height returns true if success